468,168 Members | 1,461 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,168 developers. It's quick & easy.

Combobox in datagrid, again...

Hi,

In Windows Forms the usual approach to add a combobox in a datagrid involves
adding a single combobox to the DataGrid.Controls, and then selectively
displaying it as needed when a combobox cell becomes the currentcell.
However I'm looking for a way to add a control to a cell in each row from
the actually set up and source binding of the datagrid. I'd like to have the
combobox visible at all times (kind of hard to know that one can change the
values otherwise), the mentioned approach hides the only combobox once the
cell loses focus, to have it ready for display on the next cell that get
focus.

Does anyone have an article about something like this or have a few hints on
how this could be achieved?

Richard
Nov 16 '05 #1
1 1461
If you have implemented your own DataGrid column extending the
TemplateColumn, you can allways paint an inexistent dropdown using the
System.Windows.Forms.ControlPaint.DrawComboButton( .... )

method.

"Richard Hallgren" <ri*******@dreamforce.se> schrieb im Newsbeitrag
news:e1**************@TK2MSFTNGP12.phx.gbl...
Hi,

In Windows Forms the usual approach to add a combobox in a datagrid involves adding a single combobox to the DataGrid.Controls, and then selectively
displaying it as needed when a combobox cell becomes the currentcell.
However I'm looking for a way to add a control to a cell in each row from
the actually set up and source binding of the datagrid. I'd like to have the combobox visible at all times (kind of hard to know that one can change the values otherwise), the mentioned approach hides the only combobox once the
cell loses focus, to have it ready for display on the next cell that get
focus.

Does anyone have an article about something like this or have a few hints on how this could be achieved?

Richard

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by TT (Tom Tempelaere) | last post: by
12 posts views Thread by Lars Netzel | last post: by
3 posts views Thread by Art | last post: by
1 post views Thread by fiaolle | last post: by
2 posts views Thread by mfleet1973 | last post: by
4 posts views Thread by JJGarcia | last post: by
10 posts views Thread by Doug Bell | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.