Gridview columns resize

8 posts, 0 answers
  1. Kristof
    Kristof avatar
    32 posts
    Member since:
    Oct 2006

    Posted 12 Jul 2007 Link to this post

    Hi,

    when I set the columns in a gridview to autosize, initialy everything looks fine. But when the form and thus the grid is resized, the most right columns starts growing and will eventually be the only visible column.
    This also applies when the grid is not resized but redrawn. It seems there's something wrong with the calcualtion of the column widths. Is this a known issue?

  2. Georgi
    Admin
    Georgi avatar
    212 posts

    Posted 12 Jul 2007 Link to this post

    Hello Kristof,

    Thank you for reporting this.

    Yes, this is a well known issue and it is already fixed in the latest Q1 2007 SP2 release of our controls.

    If you find any other issues, please do not hesitate to write us.

    All the best,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. fgalarraga
    fgalarraga avatar
    18 posts
    Member since:
    May 2007

    Posted 11 Aug 2007 Link to this post

    I've just installed SP2 and I am having the same issue.  Was this fixed in Q1 2007 SP2?  My referenced DLL are as follows:

    Telerik.WinControls.GridView
    Runtime Version: v2.0.50727
    Version: 3.5.0.0

    Thank you,
    Frank
  5. Georgi
    Admin
    Georgi avatar
    212 posts

    Posted 13 Aug 2007 Link to this post

    Hello fgalarraga,

    Sorry for the inconvenience, but we cannot reproduce this problem with the SP2 release. Will it be possible to send us your test project? It is possible that we are missing something, so we would like to check your exact case. Thanks in advance.

     
    Regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. fgalarraga
    fgalarraga avatar
    18 posts
    Member since:
    May 2007

    Posted 20 Aug 2007 Link to this post

    Found a work around but is this the best solution?

    Thank you,
    Frank

    'Resize column width for best fit
    For Each gvC As Telerik.WinControls.UI.GridViewColumn In gvResults.Columns
          gvC.BestFit()
    Next
  7. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 21 Aug 2007 Link to this post

    Hello fgalarraga,

    Yes, this workaround will do the job for the moment. With Q2 2007 there will be no need of using it and you may mark it as a temporary fix.
     

    Best wishes,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. jtby
    jtby avatar
    43 posts
    Member since:
    Feb 2007

    Posted 10 Dec 2008 Link to this post

    Hi -

    First, how do you set columns in gridview to autosize?  I cannot seem to find any radgridview property for this.

    Second, BestFit is not a member of Telerik.WinControls.UI.GridViewColumn, so that does not work either.  I am using the current release 8.1.0.0 (1204)

    I would like my columns to automatically resize to fit the contents of the cells.

    Thanks,
    JB
  9. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 12 Dec 2008 Link to this post

    Hello John,

    Thank you for contacting us.

    You should call the BestFit method of GridViewDataColumn in order to resize a column in RadGridView. Call the BestFitColumns method of MasterGridViewTemplate to auto size all columns. Take a look at the following code snippet:

    this.radGridView1.MasterGridViewTemplate.BestFitColumns(); 


    Should you have any other questions, feel free to write us.

    Kind regards,
    Jack
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for WinForms is Visual Studio 2017 Ready