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
1230
XamDockManager and XamGrid
posted

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...

Parents
  • 1670
    posted

    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.

Reply Children
No Data