Hi
I have a grid bound to a dataset. In one of the colulms i have a code field and and a value list associated with it. When the user selects a value from the dropdown i want to check the underlying code to see if it matches a certain criteria.
I am currently trapping the CellListSelect event as below.
private void ultraGrid1_CellListSelect(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { // CellListSelect gets fired when an item from a drop down is selected when editing // a cell. Cell would have to be in edit mode for this to get fired. Following code // prints out the selected item idex for value list drop downs. if ( null != e.Cell.Column.ValueList ) { int itemIdex = e.Cell.Column.ValueList.SelectedItemIndex; Debug.WriteLine( "Selected Item Index = " + itemIdex ); } }
The probem is that the valuelist always seems to be null. So how do i check the underlying code of the item that was selected?
I found it.
string selectedCode = e.Cell.ValueListResolved.GetValue(e.Cell.ValueListResolved.SelectedItemIndex).ToString();
I think you could also just use e.Cell.Value