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
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
Hi Georgi,
In my case, StackPanel is defined within a Template and this template is applied to the TilePane. I want to set XamWebChart's height and width. Chart's height and width are not changing as per the (state)changes of XamWebTileView. Will you let me know, how to achieve this. No where, i hardcoded chart's height or width.
and please let me know how to fetch internal controls details, as you said using GetTemplateChild() or VisualTreeHelper; so that i will try to set Height and Width using the retrieved chart control.
Thank you
Ashok
<DataTemplate x:Key="UserTemplateMaximized">
<StackPanel>
<TextBlock ... />
<igChart:XamWebChart ...></igChart:XamWebChart>
</StackPanel>
</DataTemplate>