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

Access SfDataGrid GetVisualContainer() in Loaded event when Grid is hidden returns null

Hi,

we try to register on 
this.Datagrid1.GetVisualContainer().ScrollOwner.ScrollChanged
However GetVisualContainer returns NULL even in Loaded event of the Grid, when the Grid is not yet visible.

How can we work around this issue? I don't like registering on the global IsVisibleChanged, because the grid will be hidden / displayed multiple times later on.

Thanks for your help!

3 Replies

MK Muthukumar Kalyanasundaram Syncfusion Team February 15, 2017 10:01 AM UTC

Hi Volker, 
 
Thank you for contact Syncfusion support. 
 
We have analyzed your query. But we could not able to reproduce the reported “ to access the SfDataGrid GetVisualContainer().ScrollOwner in Loaded event  returned as Null” issue at our end. We have created a sample based on your requirement. Please find the sample location below, 
 
Sample
 
If your  requirement is different from us  then could you please share some information about your requirement along with your Syncfusion product version or could you please revert the attached sample based on your scenario along with the exact replication procedure with us? This would be more helpful for us to proceed further.     

Regards, 
Muthukumar K  



VH Volker Holz February 16, 2017 08:17 AM UTC

Hi Syncfusion,

just set the Visibility of the Grid to Collapsed in the Xaml, this will reproduce the situation.

Regards, Volker


JG Jai Ganesh S Syncfusion Team February 18, 2017 01:46 AM UTC

Hi Volker,  
We have analyzed your query and we regret to inform you that you can get the visual container when the grid is in visible otherwise this becomes null. However, you can get the visual container of the grid by visible the grid at runtime (Button click). 
Regards, 
Jai Ganesh S 
 


Loader.
Up arrow icon