Appframe Knowledge Base


1 hits
0

How to set the datanavigator to active tab page grid

#Region "Set datanavigator datasource and custom tabspecific whereclause"
    Private Sub cMainTab_SelectedPageChanged(ByVal sender As System.Object, ByVal e As DevExpress.XtraTab.TabPageChangedEventArgs) Handles cMainTab.SelectedPageChanged
        ' Find and select the grid:
        For Each ctrl As Control In Me.cMainTab.SelectedTabPage.Controls
            If TypeOf ctrl Is Appframe3.Win.Controls.afGrid Then
                Dim vWhereclause As String = ""
                DataNavigator.DataSource = CType(ctrl, Appframe3.Win.Controls.afGrid).DataSource
                DataNavigator.cDataNavigator.DataSource = CType(ctrl, Appframe3.Win.Controls.afGrid).DataSource
                Try
                    DataNavigator.afReloadData()
                Catch ex As Exception
                    CR3.HandleException(ex)
                End Try
            End If
        Next
        If cMainTab.SelectedTabPage.Name = cTabStart.Name Then
            DataNavigator.Visible = False
        Else
            DataNavigator.Visible = True
        End If
    End Sub
#End Region

win · Perma link post comment Posted by: Werner Waage (21-feb-2012)