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.

Customization of row height Sfdata grid

Thread ID:

Created:

Updated:

Platform:

Replies:

129984 Apr 13,2017 07:01 AM Apr 14,2017 12:37 AM UWP 1
loading
Tags: SfDataGrid
MURALI KRISHNA
Asked On April 13, 2017 07:01 AM

Hi ,
I am new to UWP development, I am using syncfusion controls in my application. I am using datagrid, i am displaying few lengthy text in some columns, i set TextWrap for those columns. when the text is more, the top and bottom of the content is collapsing due to insufficient  vertical space, how to adjust the ROW height automatically with the content is large. I set Rowheight="45"  for SfDataGrid. even i removed that property it's not changing.

Please give me solution. Thanks in advance,


Gobikrishnan Murugesan [Syncfusion]
Replied On April 14, 2017 12:37 AM

Hi Murali, 
 
Thank you for contact Syncfusion support. 
 
We have analyzed your query. You can able to achieve your requirement by using QueryRowHeightEvent in SfDataGrid as like below code sample, 
 
Code sample: 
GridRowSizingOptions gridRowResizingOptions = new GridRowSizingOptions(); 
 
//To get the calculated height from GetAutoRowHeight method.     
double autoHeight = double.NaN; 
 
// The list contains the column names that will excluded from the height calculation in GetAutoRowHeight method. 
List<string> excludeColumns = new List<string>();  
     
this.dataGrid.QueryRowHeight += dataGrid_QueryRowHeight; 
     
gridRowResizingOptions.ExcludeColumns = excludeColumns; 
     
 
void dataGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e) 
{ 
    if (this.dataGrid.GridColumnSizer.GetAutoRowHeight(e.RowIndex, gridRowResizingOptions, out autoHeight)) 
    { 
        if (autoHeight > 45) 
        { 
            e.Height = autoHeight; 
            e.Handled = true; 
        } 
    } 
} 
 
 
UG Link for more information about auto row height: 
Sample Link: 
Regards, 
Gobikrishnan 


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.

;