This is a migrated thread and some comments may be shown as answers.

BestFitColumns not working

1 Answer 128 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 2
Michael asked on 21 Apr 2009, 11:36 PM
I'm finding that if I call BestFitColumns, the column widths are set to one pixel.  I'm guessing this is happening because I call it too early, before the columns have been filled with data.  Can you suggest a good time to call this method?  Also, is it possible to combine the best fit behavior and still make one of the columns be "stretchy" -- i.e. take up the remaining space?  My goal is that all but one of the columns would size to their content, and that the remaining column would stretch to consume the remaining space.

1 Answer, 1 is accepted

Sort by
0
Accepted
Nick
Telerik team
answered on 22 Apr 2009, 03:58 PM
Hello Michael,

Thank you for contacting us. Any time when you invoke the function it measures the strings in the cells and resizes the columns appropriately. You should call the function at any moment you deem appropriate, but there should be some cell values, so that the function can perform some meaningful measure.

You may set the column width explicitly using the Width property. We do not support the stretching functionality out of the box that you mentioned so you have to write your own implementation about that. I hope this helps. Do not hesitate to write me back if you have further questions or comments.

All the best,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Michael
Top achievements
Rank 2
Answers by
Nick
Telerik team
Share this question
or