Hello,
In my control, which inherits from UltraGrid, I implement IUIElementDrawFilter interface to do custom painting of the cells.
I also want to be able to override the preferred cell size to be used when user clicks to perforn auto-sizing of the column.
By default, the grid uses some kind of internal mechanism to determine the preferred cell size (maybe something like Graphics.MeasureString(Cell.Value.ToString()) / not exacly these methods, but you get my idea).
Please let me know if you know how to override the preferred cell size.
Cheers,Andrey
SINGHXLb said:Do we have any property for Ultrawebgrid columns , i want it to set width automatically to fit the content of the cell.
This forum is for WinForms controls. I'm afraid I don't know anything about the UltraWebGrid. You should post your question in the WebGrid forum.
Do we have any property for Ultrawebgrid columns , i want it to set width automatically to fit the content of the cell.
Hi Andrey,
The grid gets the size of each cell from the editor in that call. So the only way I can think of to do something like this would be to derive your own editor class. Perhaps you could derive from one of the existing editors and override the GetIdealSize method and use the derived editor for the column. Which editor you use depends on the data type of the column and what you are displaying. You might want to look at the EditorResolved property of a cell in the existing column and see what type of editor it is already using and then derive from that.