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
1060
Trap ItemNotInLIst on cell ValueList or Combo or DropDown
posted

I am trying to implement the following

User is entering data in a grid.. one of the columns is handled by a drop down (can be a value list or any of the drop down, I have not preferrence)

If the data is not in the list, user is asked if he wants to create this new entry... if he says yes... a dialog window will ask him to fill in the required fields.

I have been able to do this with a ultraComboEditor in a form, using the ItemNotInlist Event.

However, when trying to do the same in a grid.. and using and UltraComboEditor as my EditorComponent, I always get stuck on the Grid.Error event and never get to the NotInListEvent.

I have played around with the grid update method... but it seems that its the cell update that is firing the error.

Anything I am not getting ?

 

Thanks

 

 

 

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi Fred,

    There's no ItemNotInList event on the grid, and the one on the Combo will not fire when that combo is used in the grid. So you will need to handle this in a grid event, not an event of the combo.

    In theory, you could use the grid's Error or CellDataError events for this. Assuming you have set the column's Style to DropDownValidate, then one or both of these events should fire when the user enters something into the cell that does not exist on the list. But I haven't tried it, so I can't say for sure that it's possible in those events.

    If those events don't work, then BeforeCellUpdate or BeforeExitEditMode would be my next choice of events. You could use cell.ValueList.GetValue to determine if that the user typed in has a matching value on the list. The method will return the index of the item or -1 if it's not found.

     

Children