Reordering of datagridview using up and down button
Posted By: thushara Posted Date: January 12, 2011
Points:2 Category :VB.Net
|
| For reordeering of rows in a bounded datagridview, i got some code from the net.I am posting it here.But while i use this code, I am getting error in the first line itself saying that CurrentRowIndex is not a member of system.windows.forms.datagridview. )Is it b;cuz of 3.5 framework.??). Can any body help me to correct the codings.
This one is for the UP button....
Dim Index As Integer = datagrid.CurrentRowIndex
If Index > 0 And Index <= datagrid.VisibleRowCount - 1 Then For i = 0 To datagrid.VisibleColumnCount - 1 CurrInd = datagrid.CurrentRowIndex() Obj = datagrid.Item(CurrInd - 1, i) datagrid.Item(CurrInd - 1, i) = datagrid.Item(CurrInd, i) datagrid.Item(CurrInd, i) = Obj Next datagrid.CurrentRowIndex = CurrInd - 1 End If datagrid.Refresh()
|
|
You must Sign In To post reply
|