BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Public Class MyGridDataBoundGrid Inherits GridDataBoundGrid Public Overrides Sub SortColumn(ByVal colIndex As Integer) Dim cm As CurrencyManager = Me.Parent.BindingContext(Me.DataSource, Me.DataMember) Dim pdc As PropertyDescriptorCollection = cm.GetItemProperties Dim pd As PropertyDescriptor = pdc.Find("Col1", True) ’assumes Col1 is primary key column Dim val As Object = Me(Me.CurrentCell.RowIndex, 1).Text ’ assumes 1 is the col number of the primary key col, Col1. MyBase.SortColumn(colIndex) Dim i As Integer = CType(cm.List, IBindingList).Find(pd, val) + 1 Me.CurrentCell.MoveTo(i, Me.CurrentCell.ColIndex, GridSetCurrentCellOptions.ScrollInView) End Sub End Class
>Public Class MyGridDataBoundGrid > Inherits GridDataBoundGrid > Public Overrides Sub SortColumn(ByVal colIndex As Integer) > Dim cm As CurrencyManager = Me.Parent.BindingContext(Me.DataSource, Me.DataMember) > Dim pdc As PropertyDescriptorCollection = cm.GetItemProperties > Dim pd As PropertyDescriptor = pdc.Find("Col1", True) ’assumes Col1 is primary key column > Dim val As Object = Me(Me.CurrentCell.RowIndex, 1).Text ’ assumes 1 is the col number of the primary key col, Col1. > MyBase.SortColumn(colIndex) > Dim i As Integer = CType(cm.List, IBindingList).Find(pd, val) + 1 > Me.CurrentCell.MoveTo(i, Me.CurrentCell.ColIndex, GridSetCurrentCellOptions.ScrollInView) > End Sub >End Class >