Hi,
I am using msflexgrid.. some datas has to be displayed in flexgrid. according to the size of the datas the cell width and height has to be adjust . anyoptions there to get change automatically according to the datas?
Thanks in advance,
Ganesh
Printable View
Hi,
I am using msflexgrid.. some datas has to be displayed in flexgrid. according to the size of the datas the cell width and height has to be adjust . anyoptions there to get change automatically according to the datas?
Thanks in advance,
Ganesh
You can adjust the .ColWidth and .RowHeight properties according to the size of the text to be displayed, which can be calculated by means of the TextWidth and TextHeight properties.Quote:
Originally Posted by tgganesh
Maybe for the same row the various texts to be shown in the different cells have different heights. In this case you'd have to first determine the maximum height. Similarly for texts of different widths in the same column.
See the "FlexGrid autosize" link in my signature.
It contains code that does what krtxmrtz described, but it only works for the column width - it does not deal with text that has been wrapped.
Unfortunately it is hard to determine where wrapping would take place, so I don't know how you could set the height safely if there is wrapping (if you aren't wrapping, the height will be set automatically to suit the font you are using).
Thanks for ur replies...