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
1622
Problem with UltraCombo in Win Grid
posted

I have a ultra win grid that contains several columns.  Two of the columns contain a ultra combo as as the editor control for that column.  I have no problem accessing the before drop down event of the combo box, but wwhen i try to perform logic in the ItemNotInList event of the  combo control, nothing happens, and the event is never fired. 

I do have the combo hidden on the form, so the users do not see it.  If i unhide the control and type in a value that is not in the list, the event fires.  for some reason it does not fire when added as an editor control to the grid.  Any suggestions?

  • 469350
    Suggested Answer
    Offline posted

    Hi Chris,

    When you assign an EditorControl to grid column or cell, the grid does not use the Control you assigned. All the grid does is ask the control for a copy it's internal editor. So almost no events on the control will fire when you are dealing with a grid cell. The only exception to this is the EditorButton events.

    So you need to use an event of the grid for this, not an event on the UltraCombo.So in this case, you will probably have to use the BeforeCellUpdate event and call the IsItemInList method to check for the existance of the item on the list.

    Out of curiosity - why are you using an Editor for this, anyway? If you just want to provide a dropdown list in a column, there are better, more efficient ways to do it, such as using a ValueList or UltraDropDown control. This, of course, has no bearing on your question, I just mention it as an FYI. HOWTO:What is the best way to place a DropDown list in a grid cell?

  • 1622
    posted

    Clarification:

    What i am trying to achieve is when a user enter a value into this column that is not already part of the drop down, i would like to save that value and allow them to choose it next time they use the dropdown.  I have tried setting the style of the column to drop down validate, and tried using the cellDataError event to stop the error message and then take the value in the column and save it to my database.  The problem is as soon as this event is fired, the input is already cleared from the cell.  Even when i have restore original value set to false.  I can't seem to figure this one out.  I would rather not have then have to enter the value twice.