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.
Unfortunately, activation email could not send to your email. Please try again.

ResizeToFit and Font Size

Thread ID:

Created:

Updated:

Platform:

Replies:

44059 May 11,2006 06:21 PM May 16,2006 05:46 PM Windows Forms 4
loading
Tags: GridControl
Mark Atkinson
Asked On May 11, 2006 06:21 PM

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.

Administrator [Syncfusion]
Replied On May 12, 2006 12:26 AM

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

Mark Atkinson
Replied On May 12, 2006 09:57 AM

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

Administrator [Syncfusion]
Replied On May 13, 2006 02:33 AM

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

Mark Atkinson
Replied On May 16, 2006 05:46 PM

Thanks Haneef, That sounds reasonable. Mark

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;