can a datagrid cell display one thing but have a different value, like a list box?

fguihen

Junior Contributor
Joined
Nov 10, 2003
Messages
248
Location
Eire
in a list box you can have a selected item, and a selected value. the items are shown in the list box and when you select one you can use the underlying selected value.
eg.

select "jimmy" in the list box, and the selected value property might be something like "cust_03".

is this possible with cells in a datagrid?
 
fguihen said:
in a list box you can have a selected item, and a selected value. the items are shown in the list box and when you select one you can use the underlying selected value.
eg.

select "jimmy" in the list box, and the selected value property might be something like "cust_03".

is this possible with cells in a datagrid?


if you are using a dataset you can get access to the original and current value using:

System.Data.DataRowVersion.Current
System.Data.DataRowVersion.Original

Code:
			MessageBox.Show("CurrentValue: " + dataSet11.Tables[0].Rows[dataGrid1.CurrentRowIndex][dataGrid1.CurrentCell.ColumnNumber,System.Data.DataRowVersion.Current].ToString());
			MessageBox.Show("OriginalValue: " + dataSet11.Tables[0].Rows[dataGrid1.CurrentRowIndex][dataGrid1.CurrentCell.ColumnNumber,System.Data.DataRowVersion.Original].ToString());

I hope this helps,
kmg
 
Back
Top