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
755
How to get datatemplate object
posted

Hi

I defined in the tabcontrol datagrid as item, you can see in the following code snippet.

  <Grid Margin="5,0,5,0">
        <igWindows:XamTabControl Name="_xamTabControl"
             ItemsSource="{Binding AutoLogins}"
             Theme="Metro"
             AllowTabClosing="False"
             TabItemCloseButtonVisibility="WhenSelectedOrHotTracked"
             SelectionChanged="_xamTabControl_OnSelectionChanged">
            <igWindows:XamTabControl.ItemContainerStyle>
                <Style TargetType="{x:Type igWindows:TabItemEx}" BasedOn="{x:Static igThemes:PrimitivesMetro.TabItemEx}">
                    <Setter Property="Header" Value="{Binding Server}" />
                </Style>
            </igWindows:XamTabControl.ItemContainerStyle>
            <igWindows:XamTabControl.ContentTemplate>
                <DataTemplate>
                    <igDp:XamDataGrid DataSource="{Binding Logins}" IsGroupByAreaExpanded="False"
                                      GroupByAreaLocation="None" GroupByAreaMode="DefaultFieldLayoutOnly"
                                      RecordDeactivating="DataPresenterBase_OnRecordActivated"
                                      LostFocus="_dataGrid_OnLostFocus">
                        <igDp:XamDataGrid.FieldLayoutSettings>
                            <igDp:FieldLayoutSettings AddNewRecordLocation="OnBottom" AllowAddNew="True" AllowDelete="True" />
                        </igDp:XamDataGrid.FieldLayoutSettings>
                        <igDp:XamDataGrid.FieldSettings>
                            <igDp:FieldSettings AllowResize="False" LabelWidth="200" LabelTextAlignment="Center" />
                        </igDp:XamDataGrid.FieldSettings>
                    </igDp:XamDataGrid>
                </DataTemplate>
            </igWindows:XamTabControl.ContentTemplate>
        </igWindows:XamTabControl>
    </Grid>

My question is, how can I get the XamDataGrid object within _xamTabControl_OnSelectionChanged event. What I want to do is to validate, if any datarecord in the xamdatagrid is empty.

Thanks