We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Column width for new columns

Hi, I am removing and inserting the columns.for the newly inserted columns ,width becomes very less. I am trying resizeToFit in the Model_QueryColWidthEvent but now helping. Which method should be used and where it should be called?

3 Replies

AD Administrator Syncfusion Team December 14, 2004 03:22 AM

After you insert your columns, try calling grid.Model.ResetVolatileData and then call resizetofit. If that does not work, after you insert your columns, try calling grid.Refresh and then resizetofit.


AD Administrator Syncfusion Team December 14, 2004 07:19 PM

I tried both the options it is not working. When i load the grid for the first time i called following.For the first time its working and same method i called after insert columns its not working. this.m_PretestListingGrid.Model.ColWidths.ResizeT oFit( GridRangeInfo.Row(0)); >After you insert your columns, try calling grid.Model.ResetVolatileData and then call resizetofit. > >If that does not work, after you insert your columns, try calling grid.Refresh and then resizetofit.


AD Administrator Syncfusion Team December 15, 2004 03:10 AM

If you are trying to resize headers (you listed row 0 in your call), then you need to make sure you use the IncludeHeaders resize option. Model.ColWidths.ResizeToFit(GridRangeInfo.Row(0), GridResizeToFitOptions.IncludeHeaders);

Loader.
Live Chat Icon For mobile
Up arrow icon