If I define a XamGrid using XAML and place it inside a XamDockManager, when I go to set the ItemsSource of the grid in the code behind, my XamGrid is null. Why would hosting it inside the XamDockManager make the reference null in the code behind? I can create a new XamGrid in code but my layouts that I defined in XAML are gone and I would then have to redefine the layout using C#? Even though my sample is small even zipped it will not attach.
<ig:XamDockManager.Content>
<ig:DocumentContentHost Orientation="Horizontal">
<ig:DocumentContentHost.Panes>
<ig:TabGroupPane >
<ig:ContentPane Header="My Time Transfers" Height="Auto" Width="Auto" IsActivePane="True" AllowClose="False" IsDocumentPane="True"IsEnabled="True" IsFloating="False" AllowDockingBottom="False" AllowDockingFloating="False"AllowDockingTop="False" AllowPinning="False" CloseButtonVisibility="Collapsed" PinButtonVisibility="Collapsed" >
<ig:XamGrid x:Name="dataGrid"
etc...
Thank you for taking the time to look at my issue. I worked around the issue by using buttons and the grid visibility to simulate what I would have done with XamDocManager. Sounds like a lot of work to host the grid in the dock manager and then gain access to it.
Hello drdonna,
if you want to get the reference to the XamGrid, first you have to set a x:Name to the ContentPane that is containing the XamGrid and find it by using the FindPane("theNameOfContentPane") - this is a method of XamDockManager. When you have saved the reference to a local ContentPane you have to use method FindName("dataGrid") for that pane to find the XamGrid. That should be enough to find and use the XamGrid. Let me know if that is helping in your scenario! Thank you in advance!
Regards,
Nikola.