Hi,
Would sb know how to capture a "Selected Item Change", from DataGridViewComboBoxColumn. (This would be a DataGrid Column, with a combo box format. (winforms)).
Thanks.
Printable View
Hi,
Would sb know how to capture a "Selected Item Change", from DataGridViewComboBoxColumn. (This would be a DataGrid Column, with a combo box format. (winforms)).
Thanks.
It would actually be a DataGridView column. A DataGrid is not the same thing as a DataGridView.Quote:
Originally Posted by Rauland
The column has no event for a selection change because the column may contain hundreds or even thousands of cells. Each of those cells will contain a ComboBox control if and when it is being edited. Different cells may use the same or different ComboBox controls at different times. This is how the DataGridView works. It creates a control of the appropriate type when a cell needs to be edited. It also reuses the same control in different cells to increase efficiency.
So, what do you do? You handle the EditingControlShowing event, at which point you know a control has been created for editing a cell. You can check whether the e.Control property refers to a ComboBox control and, if it does, attach a handler to its SelectionChangeCommitted or SelectedIndexChanged event. Just note that making a selection in a combo box cell does not change the value in that cell until the editing session is ended, which basically means when the user moves to another cell.
Thanks Jmcilhinney, wouldn´t of solved my prob without your help.
I also found this link, other people might find it useful to.
http://forums.microsoft.com/msdn/sho...12780&siteid=1