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

Can you resize a row in a grid automatically

Hi,

Is it possible to resize a row in a grid automatically, so that if text cannot fit into a column then it will wrap around onto the next line and the height of that row will be adjusted so that you can see the text?

Thanks,


3 Replies

SR SubhaSheela R Syncfusion Team June 30, 2008 11:18 AM UTC

Hi Adrian,

Thanks for your interest in Syncfusion products.

Below is the code snippet to adjust the RowHeight of the grid.


this.gridDataBoundGrid1.Model.ColStyles[1].AutoSize = true;
this.gridDataBoundGrid1.Model.ColStyles[1].WrapText = true;
this.gridDataBoundGrid1.Model.RowHeights.ResizeToFit(GridRangeInfo.Table());


You can refer the below forum thread also:

http://www.syncfusion.com/support/forums/message.aspx?MessageID=36669

Please let me know if it helps.

Regards,
Subhasheela R




SM Steven Mohnkern June 3, 2009 09:58 PM UTC

Can you do this same thing with GridGroupingControl?


LS Lingaraj S Syncfusion Team June 8, 2009 05:29 PM UTC

Hi Adrian,

Thank you for your update.

The GridGroupingControl the ResizeToFit in RowHeights can be done through a CustomEngine which calculates each rows. Please try using CustomEngine of resizable rows to achieve the ResizeToFit heights behavior in GridGroupingControl. If you want WrapText behaviour in GridGrouping control, then please try using WrapText and AllowEnter property in QuereyCellStyleInfo event and RezizeToFit method in TableControlCurrentCellChanged event to achieve this behavior in GridGroupingControl.

Please refer the sample in below link:
http://files.syncfusion.com/support/samples/Grid.Windows/Forums/WrapText.zip

This sample demonstrate the Wrap Text behavior in GridGroupingControl.

Let me know if you have any queries.

Regards,
Lingaraj S.

Loader.
Live Chat Icon For mobile
Up arrow icon