Increase height of a particular row.
Thank you for your interest in Syncfusion products.
We have analyzed your query. We have created simple sample based on your requirement. When large text in collection is loaded to the grid and columns have defined TextWrapping with wrap the content is wrapped with the default row height. The row height can grow automatically with the text length by handling QueryRowHeight event. The QueryRowHeight event is called again for that row alone and it resizes the row based on the edited content. The row to be resized with text that you have typed after editing in the cell, you can use CurrentCellEndEdit event and it will reset the row height internally. Please refer the attached sample and link,
Sample: http://www.syncfusion.com/downloads/support/forum/118746/SfDataGrid_RowHeight-663259469.zip
Link:
http://help.syncfusion.com/ug/wpf/index.html#!Documents/autorowheight.htm
http://help.syncfusion.com/ug/wpf/index.html#!Documents/howtherowheightcanautogrowwiththetextlength.htm
Please let us know if you have any concerns.
Regards,
Muthukumar K
Please ignore the previous update where we have provided sample for WPF. Please find the details regarding your requirement in WinRT.
In WinRT, it is not possible to listen Key events of TextBox loaded inside Grid, in Grid level as WinRT doesn't support Preview events. So it is not possible to change the height of the row based on the content you are typing. But it is possible to set height of row in on-demand mode by handling SfDataGrid.QueryRowHeight event.
Refer the below documentation for more information.
http://help.syncfusion.com/UG/winrt/index.html#!Documents/autorowheight.htm
http://help.syncfusion.com/UG/winrt/index.html#!Documents/howcantherowheightautogrowwithtextlength.htm
Please let us know if you have any questions.
Thanks,
Muthukumar K
Hi Avdesh,
You can access the collection of rows in SfDataGrid through VisualContainer and you can set the Height for individual rows also as in the below code snippet.
using Syncfusion.UI.Xaml.Grid.Helpers; this.grid.Loaded += grid_Loaded; void grid_Loaded(object sender, RoutedEventArgs e) { var visualContainer = grid.GetVisualContainer(); var rowcount = visualContainer.RowHeights.LineCount; // specific row height visualContainer.RowHeights[3] = 70; visualContainer.InvalidateMeasure(); } |
Note: This is not recommended way. While sorting and grouping these settings will reset. If the above way meets your requirement you can use this.
Please let us know if you have any questions.
Thanks,
Sivakumar
- 5 Replies
- 3 Participants
-
AC Avdesh Chaudhary
- Apr 7, 2015 06:18 AM UTC
- Apr 11, 2015 01:53 AM UTC