ComboBox Drop Up in Grid?

L

localhost

I have a ComboBox inside my WinForms DataGrid. The grid has about 10
rows. The ComboBox has 100+ items in it. When I access the ComboBox
on grid row 10, the list flies off the bottom of the form window and I
can't see even the scrolling arrows on the ComboxBox.

How can I make it "scroll up" so that I always get a full view of the
combo?


Thanks.
 
Y

Ying-Shen Yu[MSFT]

Hi primpilus,

I'm a bit not clear, could you give us more detail information about this
issue, how you add a combo box into the winform datagrid?

Simply adding the combo box by DataGrid.Controls. Add method may not be a
good choice, since DataGrid class is directly derived from Control class
not ContainerControl class, so it does not support containing child
controls in general way.

If you are trying to customize a datagrid column, you may try deriving from
the DataGridColumnStyle class instead. For how to create a customized the
datagrid column style, you may read the follow article

<Customizing the Windows Forms DataGrid>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/
html/wnf_CustDataGrid.asp

And there are also many articles and sample codes for customizing datagrid
in www.codeproject.com, here are some articles related to your issue:

<ComboBox in DataGrid>
http://www.codeproject.com/cs/miscctrl/RenDataGridComboBoxColumn.asp

<DataGrid Zen Novice>
http://www.codeproject.com/cs/miscctrl/DataGridZen.asp?df=100&forumid=31224&
exp=0&select=715228

You may found more information about this topic on CodeProject and other
similiar web sites.

If these suggestions does not help to resolve your problem, please feel
free to reply this thread and let us know more about what effect would you
like to get.

Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 
L

localhost

I have a tabbed page.

Inside the tabbed page is a DataGrid.

The DataGrid can visibly show 12 items at a time before the user needs
to scroll down.

Inside the DataGrid is a column with a DropDown control. The DropDown
control has 110 items in it and requires scrolling to step through the
items.

If the current DataGrid row is in visible row 11 or 12 and the
DropDown is selected, the DropDown's list goes "under" the bottom of
the grid window. This makes it impossible to click the down arrow to
scroll the DropDown, and all the user can see is the first 1-2 items
in the list.

I think what needs to happen is the behavior of the DropDown needs to
"drop up" instead, or the grid rectangle needs to allow the DropDown
to show something outside of the grid's rectangle.


Hopefully that clears it up, this is very frustrating.

Thanks.
 
Y

Ying-Shen Yu[MSFT]

Hi,

Thanks for your reply,

I did some test based on your description, it seems work fine. I put a
datagrid on a tab page and add one column with a combobox column style,
when I select the last visible row in the datagrid , the combobox appreared
and the dropdown window is shown over the grid window.

Do you have any 3rd party control on your form?
If yes, you may try testing this issue on a Form, with a datagrid and this
column style only,

If you have a simple sample to reproduce this problem please feel free to
send it to my email box to let me take a look at it.

Thanks!
Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 
J

James Leech

Ying-Shen Yu

I don't suppose you still have your sample for embedding controls into
datagirds. If you do still have it, I would appreciate a copy of it - this
is a topic I am struggling with at the moment. Also if you have any
information on grouping results in a datagrid that would be very helpful
too.

Many Thanks
James Leech
tgl
 
Y

Ying-Shen Yu[MSFT]

Hi James,

If you are looking for embedding a control into datagrid using
DataGridColumnStyle , you may take a look at the sample in
DataGridColumnStyle class , there is a sample for hosting a DateTimePicker
in the datagrid. Also there are lots of the sample about DataGrid column
style on the CodeProject, a quick google search will give you the links (
try "datagrid column style site:www.codeproject.com").

Thanks!
Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top