473,320 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1667
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: PeterZ | last post by:
G'day, After doing much searching and pinching bits of ideas from here there and everywhere I came up with a fairly 'clean' solution of including a comboBox into a dataGrid column. You can...
3
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article:...
0
by: AR | last post by:
I have a datagrid containing a single combobox column. It also contains an 'Add New Row' button at the bottom of the datagrid. The datagrid is in a form that contains 'Save' and 'Restore' buttons....
12
by: Lars Netzel | last post by:
I have, in earlier projects, had som serious problems with ComboBoxColumns in a datagrid. And now I'm in a projects where I needs sometthing like that again.. but I really do not want to work with...
3
by: Art | last post by:
Hi, Forgive me for posting this message in 2 groups -- it appears that the Data Access group isn't very active, so I'm posting again here: I have a DataTable that I want to fill using a...
1
by: fiaolle | last post by:
Hi The first set of source code is the class for a combobox in a grid, hopefully. In the second set of code we try to use the combobox class, but the grid is empty. I don't understand how this...
2
by: mfleet1973 | last post by:
Hello (again), Within my datagrid I add a control to the datagridtextboxcolumn when the underlying textbox receives focus as follows: Combobox1.Size = New...
4
by: JJGarcia | last post by:
Hi Everyone, I'll try to explain the process I'm following, I'm new to this so I'm triying the easy way first, probably the lasyest too! I created a new Project, drag in to it a SQLConnection,...
10
by: Doug Bell | last post by:
Hi I am still having problems with Tabbing through a DataGrid with a DataGridComboBox Column. I need to allow the User to Type the value into the ComboBox so consequently its ComboBoxStyle is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.