BestFitColumns not working

2 posts, 1 answers
  1. Michael
    Michael avatar
    33 posts
    Member since:
    Mar 2009

    Posted 21 Apr 2009 Link to this post

    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.
  2. Answer
    Nick avatar
    767 posts

    Posted 22 Apr 2009 Link to this post

    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,
    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.
Back to Top