Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
575
How to Autofit WebGrid Columns
posted

how can i autoFit Columns on the WebGrid , also how can i made Extend Last Column in the Grid as the WinGrid ?

 

Thanks

Parents
  • 3732
    Verified Answer
    posted

    Hi,

    There are few ways to auto resize the columns present in a WebGrid.

    1) The TableLayout property in the DisplayLayout can be set to "Auto". This property can be set either in Design Mode or in Code Behind. Here is the line of code:

    this.UltraWebGrid1.DisplayLayout.TableLayout = Infragistics.WebUI.UltraWebGrid.TableLayout.Auto;

    2) The PerformAutoResizeColumns method can be used as follows,

    this.ultraGrid1.DisplayLayout.PerformAutoResizeColumns(false, PerformAutoSizeType.VisibleRows);

    3) This also can be done using JavaScript. Please refer to this forum thread

    http://forums.infragistics.com/forums/t/4650.aspx

    The WinGrid has a set up to make the last column to be extended. In the WebGrid, this feature is not available through a direct property set up. But I'm sure the width of the last column can be set manually to achieve the functionality.

    Hope this helps.

    Thanks

     

Reply Children
No Data