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

Resize to Fit

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.

4 Replies

AD Administrator Syncfusion Team 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


ED Erwin Davidse 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


ED Erwin Davidse May 3, 2006 12:21 PM UTC

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


AD Administrator Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon