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
710
How to set editor on a cell-by-cell basis.
posted

I would like to have a column where the data to be edited is of different types.  (typed as"object", but the data record derived classes return specific data types.)

I have been fooling around with the cell's Editor and EditorControl properties but to no avail.  The only thing that compiles and runs is when I use an EditorWithText in the editor. In that case I can edit a string value, but when the data is saved, the original value, not the edited value is returned.

I have been unable to get an EditorWithMask to work to edit a datetime type.  I think I constructed/initialized the editor wrong for the datetime type, but have no idea how to do so.

No attempts with EditorControl have been successful.   I am not sure what classes to use.  Nothing seems to derive from the IProvidesEmbeddableEditor interface.

Any help would be appreciated.

 thanks 

 

 

  • 469350
    Verified Answer
    Offline posted

         Typically, what you would do is use the InitializeRow event of the grid to assign an EditorControl to the cell. The editor controls are mostly in the Infragistics.Win.UltraWinEditors assembly. For dates, you would use an UltraDateTimeEditor (or you could use the UltraCalendarCombo from the UltraWinSchedule assembly). 

         I'm not entirely sure that the DateTime editor(s) can handle being used in a column whose DataType is object. You might get an exception regarding the ExpectedType. If that's the case, then you would need to use a DataFilter to convert the object to and from a date and set the ExpectedType.