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
close icon

GridDataboundGrid ResizeToFit Problame

Hello,

I am using multiple (at least 20) GridDataboundGrid in one form and and i wanted to automatically set the Column width. I know who to use ResizeToFit but the problam is, once i started to use Async methods to load data, the ResizeToFit call fails to return. In fact is the form becomes unresponsive and I am forced to manually end the process.

Please note that the Grids are bounded to data tables and the tables are populated through a datareader object.

The data could be a lot ( in 10's of thousands)

Do u have an idea why the method resizetofit is failing on Async processing

any insight is welocme

thank you.



1 Reply

NA Nisha Arockiya A Syncfusion Team November 24, 2008 11:49 AM UTC

Hi Ephem,

Thanks for your interest in Syncfusion Products.

In case of the GridDataBoundGrid, by default, the grid will resize its columns accordingly to text in the column. Please try calling the ResizeToFit method after setting format properties in load event.
+++++++ Code Snippet +++++++++
this.gridDataBoundGrid1.AllowResizeToFit = false;
this.gridDataBoundGrid1.Model.ColWidths.ResizeToFit(this.gridDataBoundGrid1.ViewLayout.VisibleCellsRange, Syncfusion.Windows.Forms.Grid.GridResizeToFitOptions.IncludeHeaders);
+++++++ Code Snippet +++++++++

Sample:
http://websamples.syncfusion.com/samples/kb/grid.windows/GDBGColwidth/main.htm

Please let me know am I missing anything.

Regards,
Nisha


Loader.
Live Chat Icon For mobile
Up arrow icon