Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
415
Determine DropdownList Value Selected
posted

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?

 

Parents
No Data
Reply
  • 415
    Verified Answer
    posted

    I found it.

    string selectedCode = e.Cell.ValueListResolved.GetValue(e.Cell.ValueListResolved.SelectedItemIndex).ToString();

Children