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

ResizeToFit and Font Size

I''m trying to adjust the height of the rows in my grid because the first column is using 20 point font. So I''m doing this: Model.RowHeights.ResizeToFit (GridRangeInfo.Rows (1, Model.RowCount), GridResizeToFitOptions.None); But that doesn''t seem to change anything. Is there any known issues in this regard? I''m doing this right after binding the data source but I think maybe some of the suspend/resume binding stuff I''m doing elsewhere might be causing some problems.

4 Replies

AD Administrator Syncfusion Team May 12, 2006 04:26 AM UTC

Hi Mark, Please refer to the forum thread for more details. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=43705 Thanks for choosing Syncfusion Products. Best Regards, Haneef


MA Mark Atkinson May 12, 2006 01:57 PM UTC

Hi Haneef, I had a look at that thread and I''m not sure it''s quite the same as my issue. The fonts in all my cells are set correctly. I''m just not sure that I''m calling ResizeToFit at the right time. Ideally, I''d just like the grid rows to "know" that they''ll have to be slightly bigger to accomodate the data that will soon populate them. I think ResizeTofit isn''t working for me because when I call it, I don''t have any data in the grid yet. I''m almost done binding the data when I call ResizeToFit but I haven''t "resumed" binding in the calling class. Something like this (a little bit pseudo code but you get the idea): In some parent form class: SuspendBindingOnGrid(); grid.BindTheData (dataSource); ResumeBindingOnGrid(); In my derived grid class: BindTheData (dataSource) { AddGridBoundColumns(); // set up fonts, stylesm,etc AddDataBindings(dataSource); // add data source, data memeber, etc Model.Rows.Size.ResizeToFit (GridRangeInfo.Table()) } >Hi Mark, > >Please refer to the forum thread for more details. >http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=43705 > >Thanks for choosing Syncfusion Products. >Best Regards, >Haneef


AD Administrator Syncfusion Team May 13, 2006 06:33 AM UTC

Hi Mark, ResizeToFit method resizes a range of rows or columns to optimally fit stored contents of the specified range of cells.It depends on the data stored in a Grid.If the Grid doesn''t have any data, ResizeToFit method doesn''t make any changes in a Grid.Here is a code snippet. In some parent form class: SuspendBindingOnGrid(); grid.BindTheData (dataSource); ResumeBindingOnGrid(); //After fill the datasource in a grid, you need to call the ResizeToFit method. >>>>>>>>>>>>>>Modification <<<<<<<<<<<<<<< this.Grid.Model.RowHeights.ResizeToFit (GridRangeInfo.Table()); >>>>>>>>>>>>.>End Modification<<<<<<<<<<<< In my derived grid class: BindTheData (dataSource) { AddGridBoundColumns(); // set up fonts, stylesm,etc AddDataBindings(dataSource); // add data source, data memeber, etc //Model.Rows.Size.ResizeToFit (GridRangeInfo.Table()) } Please let me know if this helps. Best Regards, Haneef


MA Mark Atkinson May 16, 2006 09:46 PM UTC

Thanks Haneef, That sounds reasonable. Mark

Loader.
Live Chat Icon For mobile
Up arrow icon