Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to find sort colum
Message
De
20/08/2006 12:42:22
 
 
À
20/08/2006 10:28:56
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
VB.NET 1.1
Divers
Thread ID:
01147095
Message ID:
01147107
Vues:
16
Never mind found it.
Private Sub FindData()
        Dim ColumnName As String
        Dim intGridPointer As Int64
        'ColumnName = DataGrid1.TableStyles(0).GridColumnStyles(0).MappingName
        ColumnName = Me.dsDoctors.Doctors.DefaultView.Sort
        Dim drFounded() As DataRow
        If txtFind.Text.Trim <> "" Then
            'drFounded = DirectCast(DataGrid1.DataSource, DataView).Table.Select(ColumnName & " Like '%" & txtFind.Text.ToUpper.Trim & "%'")
            drFounded = Me.dsDoctors.Tables(0).Select(ColumnName & " Like '%" & txtFind.Text.ToUpper.Trim & "%'")
        End If
        If drFounded.GetUpperBound(0) > 0 Then
            Me.dsDoctors.Doctors.DefaultView.Sort = ColumnName
            Dim strremove(1) As Char
            strremove(0) = "["
            strremove(1) = "]"
            ColumnName.Trim(strremove)
            intGridPointer = Me.dsDoctors.Doctors.DefaultView.Find(drFounded(0).Item(ColumnName.Trim(strremove)))
            DataGrid1.CurrentRowIndex = intGridPointer
        End If
    End Sub
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform