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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Resize to Fit

Thread ID:





43705 May 1,2006 03:26 PM UTC May 3,2006 12:47 PM UTC WinForms 4
Tags: GridControl
Erwin Davidse
Asked On May 1, 2006 03:26 PM UTC

When appling resize to fit with in the columns data containing space''s the resize breaks afther the space. for example 5 1234.00 wil break in to 5... Is there a way to let the resize to fit take the whole sting into account? Regards Erwin.

Administrator [Syncfusion]
Replied On May 2, 2006 04:38 AM UTC

Hi Erwin, I have tested this issue by creating a sample using GridDataBoundGrid in v.3.3 and then again tested by upgrading to 4.1. I was not able to reproduce the issue.If you can provide more information, we can try to suggest some solution. Here is a sample. http://www.syncfusion.com/Support/user/uploads/DateBound_3ccc5e00.zip Could you please run this at your end and let me know how it goes? Thanks for your patience. Best Regards, Haneef

Erwin Davidse
Replied On May 3, 2006 12:20 PM UTC

I have found the problem. It has to do with setting the Font settings in the PrepareViewStyleInfo. We want the first rows larger than the rest. The code to to add is: void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) { if( e.RowIndex == 1 ) { e.Style.Font.Bold = true; e.Style.Font.Size = 12.5F; } } if you now resize to fit you will see the first row does not fit. Regards Erwin

Erwin Davidse
Replied On May 3, 2006 12:21 PM UTC

Sorry you need to add also th eventhandler this.gridDataBoundGrid1.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(gridDataBoundGrid1_PrepareViewStyleInfo);

Administrator [Syncfusion]
Replied On May 3, 2006 12:47 PM UTC

Hi Erwin, By default, DataBoundGrid doesn''''t store any styleinfo properties.You can not set any cell or row specific properties for the DataBoundGrid.You need to provide/store them on demand in the QueryCellInfo event.If you are planning to set any visual style info properties, you need to use the PrepareViewStyleinfo.PrepareviewStyleInfo event does not store any styleInfo properties.ResizeToFit method resize the cell based on stored styleInfo property of the cell in a grid.Could you try this code in QueryCellInfo event and call ResizeToFit method.Here is a code snippet. //Form Load this.gridDataBoundGrid1.Model.QueryCellInfo +=new GridQueryCellInfoEventHandler(Model_QueryCellInfo); private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e) { if( e.RowIndex == 1 ) { e.Style.Font.Bold = true; e.Style.Font.Size = 12.5F; } } Here is a modified sample. http://www.syncfusion.com/Support/user/uploads/DateBound_cb77fcb3.zip Please let me know if this helps. Best Regards, Haneef


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon