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
45
Using custom controls into UltraGrid's cell
posted

Hi all,

My team and I have developed a custom control based on the UltraTextEditor component. This one is used in our application in order to format the display of numerical datas, and especially for showing empty text when the data value is equal to Long.minvalue.

This component is working fine using it on window Forms, but we have complications using it into an UltraGrid : at this time we are not able to control the text displayed into a Cell when this one is not in edit mode.
We can control the datas entered into a cell because we have associated the property EditorControl of that cell to an instance of our component. Our component gives an EmbeddableEditorBase version of it, and implements the IProvidesEmbeddableEditor interface, so when we set the property MyCell.EditorControl = OurCustomEditor, the property EditorResolved of the cell is automatically assigned to the OurCustomEmbeddableEditorBase component.
The text displayed into the cell is like we wanted it, BUT when we leave that cell, the text changes and seems to show the "ToString()" text of the value (here Long.ToString()).

My question is : with an UltraGrid, how can we specify that a cell should use the EditorControl text instead of the ToString() text of the contained value ?

Thanx