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 rows on column changed

How do I get the rowcount of the datagrid?

Also when I try to follow the example on how to force a redraw after remeasureing the rows I am getting an error 

Error 44 'Syncfusion.UI.Xaml.Grid.SfDataGrid' does not contain a definition for 'GetVisualContainer' and no extension method 'GetVisualContainer' accepting a first argument of type 'Syncfusion.UI.Xaml.Grid.SfDataGrid' could be found (are you missing a using directive or an assembly reference?)

1 Reply

AN Ashok N Syncfusion Team May 13, 2015 01:06 PM UTC

Hi Henry,

Thank you for contacting Syncfusion support,

We have analyzed your query and you can resolve this problem by adding Syncfusion.UI.Xaml.Grid.Helpers namespace within the file. When you are trying to get the VisualContailner, you need to use Syncfusion.UI.Xaml.Grid.Helpers namespace in SfDataGrid. And you can get the RowCount by using VisualContainer.RowCount property. Please refer the below code example:

using Syncfusion.UI.Xaml.Grid.Helpers;

private void Button_Click_1(object sender, RoutedEventArgs e)


var visualContainer = this.datagrid.GetVisualContainer();

int rowcount=visualContainer.RowCount;


Please let us know if you require further assistance.



Live Chat Icon For mobile
Up arrow icon