Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
How to get the object inside TilePane in XamWebTileView
posted

 

 

 

 

I am trying to get the datagrid inside the first TilePane in XamWebTileView. I am trying different ways but I have no luck. Can you advise me how to do it?

TilePane tp = TileView1.Items[0] as TilePane;
Grid grid = tp.FindName("Grid1") as Grid;
DataGrid dg = tp.FindName("DataGridPanel1") as DataGrid;

Both grid and dg are null??

Thanks,
Frank

Parents
No Data
Reply
  • 6475
    posted

    Hi, Frank

    If the Grid and the DataGrid are defined within a Template and this template is applied to the TilePane (e.g. as TilePane's ContentTemplate), you'll not be able to obtain a reference to those objects using the FindName method. If that's the case, you could try using GetTemplateChild() method instead or you could use the VisualTreeHelper class to reach these objects.

    Hope that helps

Children