Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
21991 | Nov 30,2004 06:31 PM UTC | Dec 1,2004 04:35 PM UTC | WinForms | 2 |
![]() |
Tags: GridControl |
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 >
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.