I'm trying to event handle the columnchanging event in a table bound to a datagrid. One of the columns in the grid is a comboboxcolumn I got from the web - it displays fine, the valuemember and displaymember are set but when I leave the comboboxcolumn after selecting a column the value left in the column is the valuemember and not the displaymember.
I'd like to capture columnchanging, set BOTH the id field(for the database) and the description field(for the user to see) according to what has just been selected in the combobox. However as I'm handling the columnchanging event as soon as I set a value for the datarow the event is fired again (and again).
This basically means the event is fired 3 times - once on the user leaving the column, once on change of ID field and once on change of value field. I'm really struggling to apply logic to all of this, I thought I could simply capture the row, change the values in the datatable then rebind my grid to display the changes.
Does anyone have any thoughts on best practice for this - I simply want to update the datatable behind the grid with 2 values based on the combobox display and valuemember properties!!
Thanks for staying with me...
I'd like to capture columnchanging, set BOTH the id field(for the database) and the description field(for the user to see) according to what has just been selected in the combobox. However as I'm handling the columnchanging event as soon as I set a value for the datarow the event is fired again (and again).
This basically means the event is fired 3 times - once on the user leaving the column, once on change of ID field and once on change of value field. I'm really struggling to apply logic to all of this, I thought I could simply capture the row, change the values in the datatable then rebind my grid to display the changes.
Does anyone have any thoughts on best practice for this - I simply want to update the datatable behind the grid with 2 values based on the combobox display and valuemember properties!!
Thanks for staying with me...