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
60
Ultragrid combo box selected value
posted

one of the columns in the Ultragrid I am working on is a Combo Box. I want to display data on the other columns when the user just selects a value from the combo box. I used the cellchanged event of the grid but I can not get the value of the combo box when the cell is changed.

Please advise what event should I have to use to get the value of the combo box when just it is selected?

Thanks

Parents
No Data
Reply
  • 17259
    Offline posted

    In CellChange event, you have to use cell.Text instead of cell.Value since it is the old value. You can also use AfterCellUpdate event and cell.Value will be the new value, but this event if fired only after "exit edit mode", which can be caused by moving the focus to another cell, or by code.

    If you want, you can force exit edit mode when the user selects a value which make sense (I do it for checkbox also). Handle the CellChange event and write:

    if (e.Cell.StyleResolved == ColumnStyle.DropDownList)

    gris.PerformAction(UltraGridAction.ExitEditMode)

    However, this approach won't work well with DropDown or DropDownValidate styles, since any time the user add a character, edit mode will be canceled.

    You can also do it in the AfterCellListCloseUp event, but again this is not always fired for the two styles.

Children