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
695
ultra grid cell which accept only integers - How
posted

I am having ultragrid just like properties window. ie, each row has different controls on it like

1st row -> UltraCheckEditor

2nd row -> combo box

3rd row -> default text editor (which is supported by UltraGrid in edit mode)

I would like to make the 3rd row default text editor control to accept only signed integers. How can i achieve this functionality ? ONLY for CELL... not for Column...

  • 469350
    Offline posted

    Hi, 

    This is pretty complex, so I'm not sure what part of this is giving you trouble. But the basic approach to take would be to create a column (either in your DataSource or an unbound column in the grid) whose DataType is object. That way the column can handle any other data type.

    Then what you would do is handle the InitializeRow event in order to change the UI for the cells in that column to whatever you want. There are a number of ways to do this. One way would be to simply set the Style property on the cell. This will work for all of the basic styles like CheckBox and Edit (text). If you want to do something more complex, then you might need to set the ValueList on the column in addition to the style. For even more complex cases where there is no Style that does what you want, you would have to use an Editor or EditorComponent.

  • 695
    posted

    Any update on this ? how to achieve the above functionality. thank you.