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
130
Problem with fit to content option (AutoFitStyle.ExtendLastColumn not working proper)
posted

Hi,

I am using infragestic grid ( 9.2 version). I m facing problem while resizing columns.
I have write following code in grid InitializeLayout.

if (Common.FitToContentGrid) // if user want to view grid apperance as fit to content
{
this.DisplayLayout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.None;
this.DisplayLayout.Override.AllowColSizing = Infragistics.Win.UltraWinGrid.AllowColSizing.Free;
this.DisplayLayout.PerformAutoResizeColumns(false, PerformAutoSizeType.AllRowsInBand,true);
this.DisplayLayout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.ExtendLastColumn;

//  if user want to view grid apperance as fit to grid
else
{  
this.DisplayLayout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.None;
this.DisplayLayout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.ResizeAllColumns;
}

but this code doesnot work for some grids and works fine for some grids.

can someone guid me , wheather i m doing any wrong code ?