On demand row height calculation in SfDataGrid

I am calculating row height on-demand using QueryRowHeight. Once I have added the DetailsViewDefinition, its no more working. 

I saw the limitation in the help document stated that "This event is not supported for DetailsViewGrid.". 


But its not working parent data grid row too, even if the details view is in collapse state. Is this expected behavior?

Is there any possibility to calculate row height on demand for parent and details row in data grid?

Regards,
Satheesh

3 Replies

VS Vijayarasan Sivanandham Syncfusion Team April 14, 2020 02:18 PM UTC

Hi Satheesh,

Thank you for contacting Syncfusion support.

In DetailsViewDataGrid does not support the QuryRowHeight event. You can set the row height by using RowHeights property in SfDataGrid. Please refer the below code snippet,

 
this.dataGrid.Loaded += dataGrid_Loaded;

void dataGrid_Loaded(object sender, RoutedEventArgs e) 
{ 
            var VisualContainer = this.dataGrid.GetVisualContainer(); 
            VisualContainer.RowHeights[1] = 100; 
            VisualContainer.RowHeights[3] = 100; 
            VisualContainer.InvalidateMeasure(); 
}   

Regards,
Vijayarasan S




SA Satheesh April 15, 2020 09:45 AM UTC

Hi Vijayarasan,

Thanks for the update. Please provide clarification for the below query. 

Please let me know how to calculate the row height in a generic way based on the cell content. Also applied virtualization to control, need to update the row height while loading in the view port. 

But its not working parent data grid row too, even if the details view is in collapse state. Is this expected behavior?

Thanks,
Satheesh


VS Vijayarasan Sivanandham Syncfusion Team April 16, 2020 01:01 PM UTC

Hi Satheesh,

Regarding Query: its not working parent data grid row too, even if the details view is in collapse state. Is this expected behavior?
  
Yes, this is the expected behavior in DetailsViewDataGrid.

We also regret to inform you that​​​ currently, we don’t have the content-based row height increment support in DetailsViewDataGrid.

Regards,
Vijayarasan S


Loader.
Up arrow icon