Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid combobox issues

Status
Not open for further replies.

rwttm001

IS-IT--Management
Nov 20, 2002
26
GB
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...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top