I want to be able to apply custom formatting for some of the columns in the UltraGrid.
I want some of my double columns to be formatted in a specific way:
I also want this values to be editable and displayed in the same format while editing.
There is a way to achieve this for the standard Microsoft data grid by overriding the following methods of the DataGridTextBoxColumn:
Ok, thanks a lot!
The Editor is used to display the value of the cell as well as editing it. So it will work all the time.
Sorry, but the DataFilter property is available as a property of a visual column's editor, for example: DisplayLayout.Bands[0].Columns[1].Editor.DataFilter = myDataFilter;
Therefore, this conversion functionality will only work only for the editor. In cases when the editor is always visible, this will be fine. But if the editor only appears when you edit the cell, the conversion won't work when the cell is just painted, because it's not painted using the functions of corresponding DataEditor, but using the paint inplementation of its UIElement.
So, I think there is no other way, but to use custom painting...
You apply the DataFilter to the UltraGrid. This filter will be called for each stage of every cell. In the Convert method you must check to see if the cell is in a column you care about.
Thanks for your reply!
It seems to me (I haven't tried yet) that this will only work when the user is editing the value.
CellUIElement, for example, doesn't have any properties which would allow you to assign a DataFilter to be used when rendering.