Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to find sort colum
Message
From
20/08/2006 12:42:22
 
 
To
20/08/2006 10:28:56
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
VB.NET 1.1
Miscellaneous
Thread ID:
01147095
Message ID:
01147107
Views:
14
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
Previous
Reply
Map
View

Click here to load this message in the networking platform