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
125
how to Tabgrouppane add xamdatagrid binding
posted

Xaml

<igWPF:XamDockManager>
<igWPF:DocumentContentHost>
<igWPF:SplitPane Width="auto" Height="auto" SplitterOrientation="Vertical">
<igWPF:TabGroupPane ItemsSource="{Binding TabGroupItems}"> <=== binding success
<igWPF:TabGroupPane.ContentTemplate>
<DataTemplate>
<igWPF:XamDataGrid DataSource={Binding DataGridItems>       <==== how to binding??
<igWPF:XamDataGrid.FieldLayoutSettings>
<igWPF:FieldLayoutSettings AutoGenerateFields="False"/>
</igWPF:XamDataGrid.FieldLayoutSettings>
<igWPF:XamDataGrid.FieldLayouts>
<igWPF:FieldLayout>
<igWPF:FieldLayout.SortedFields>
<igWPF:FieldSortDescription Direction="Descending" FieldName="RegisterNumber"/>
</igWPF:FieldLayout.SortedFields>
<igWPF:FieldLayout.Fields>
<igWPF:Field Name="RegisterNumber" Label="Register Number" AllowEdit="False" Width="*"/>
<igWPF:Field Name="RegisterAddress" Label="Register Address" AllowEdit="False" Width="*"/>
<igWPF:Field Name="ItemName" Label="Item Name" AllowEdit="False" Width="*"/>
<igWPF:Field Name="Authority" Label="Authority" AllowEdit="False" Width="*"/>
<igWPF:Field Name="MinRange" Label="Min Range" AllowEdit="False" Width="*"/>
<igWPF:Field Name="MaxRange" Label="Max Range" AllowEdit="False" Width="*"/>
<igWPF:Field Name="Value" Label="Value" AllowEdit="False" Width="*"/>
<igWPF:Field Name="Request" Label="Request" AllowEdit="False" Width="*"/>
</igWPF:FieldLayout.Fields>
</igWPF:FieldLayout>
</igWPF:XamDataGrid.FieldLayouts>
</igWPF:XamDataGrid>
</DataTemplate>
</igWPF:TabGroupPane.ContentTemplate>
</igWPF:TabGroupPane>
</igWPF:SplitPane>
</igWPF:DocumentContentHost>
</igWPF:XamDockManager>

It was successful until creating a Tab by binding the Contentpane to the TabGrouppane.
But. I wanted to display the Xamdatagrid inside each tab, but it was not possible.
What should I do?
  • 34810
    Verified Answer
    Offline posted

    Hello Kim,

    The data context of the elements within the TabGroupPane.ContentTemplate will be the ContentPane in this case. I am guessing that your TabGroupItems collection is a collection of ContentPanes in this case? If this is the case, I would recommend that whatever object you are setting to your ContentPane.Content property has the DataGridItems collection on it. Doing this should allow you to bind to Content.DataGridItems on the XamDataGrid and bind the data source that way.

    Please let me know if you have any other questions or concerns on this matter.