Hello,
Here is the scenario in VB.net windows app.
A text column in Dataset.Datatable is bounded to a listbox. the rows in the table contains, text field1, textfield2, and numeric field represents the order of the rows.
Example
I am using the following, It does not work as expected. It's very urgent, Any light on this would be greatly appreciated.
or
none of this code works, Please help.
Here is the scenario in VB.net windows app.
A text column in Dataset.Datatable is bounded to a listbox. the rows in the table contains, text field1, textfield2, and numeric field represents the order of the rows.
Example
My questions is, dow do I manipulate the up/Dn functionality.A1 A2 0
B1 B3 1
C1 C2 2
D1 D2 3
.
.
.
I am using the following, It does not work as expected. It's very urgent, Any light on this would be greatly appreciated.
VB.NET:
If iSelectedIndex > 0 Then
iSelectedPosId = DS.Tables("Letter").Rows(iSelectedIndex).Item("PosId")
DS.Tables("Letter").Rows(iSelectedIndex - 1).Item("PosId") = iSelectedPosId
DS.Tables("Letter").Rows(iSelectedIndex).Item("PosId") = iSelectedPosId - 1
lbSent.SelectedIndex = lbSent.SelectedIndex - 1
End If
or
VB.NET:
If iSelectedIndex > 0 Then
Dim dr As DataRow
dr = DS.Tables("Letter").Rows(iSelectedIndex)
Dim newDR As DataRow
newDR = DS.Tables("Letter").NewRow
newDR.ItemArray = dr.ItemArray
DS.Tables("Letter").Rows.RemoveAt(iSelectedIndex)
DS.Tables("Letter").Rows.InsertAt(newDR, iSelectedIndex - 1)
'lbSent.SelectedIndex = lbSent.SelectedIndex - 1
End If
none of this code works, Please help.
Last edited by a moderator: