ZeroEffect
Well-known member
I know if I use the following line that my data set will be sorted by the column I want.
Here is how I am getting the data
Then the DatagridView Displays the data correctly. If the user changes the sort in the DataGridView the Data I want to retrieve from the DataGridView is messed up. So I have two questions.
1. How can I sort my DataSet when the sort changes on the DataGridView
2. How do I disable the sort on the DataGridView
Thanks
ZeroEffect
Code:
dsEvents.Tables("Events").DefaultView.Sort = "RunTime"
Here is how I am getting the data
Code:
tbEventName.Text = dsEvents.Tables("Events").Rows(DataGridView.CurrentRow.Index).Item("EventName")
tbCommand.Text = dsEvents.Tables("Events").Rows(DataGridView.CurrentRow.Index).Item("Command")
dtpTime.Text = dsEvents.Tables("Events").Rows(DataGridView.CurrentRow.Index).Item("RunTime")
cmbBox.Text = dsEvents.Tables("Events").Rows(DataGridView.CurrentRow.Index).Item("ComPort")
Days(dsEvents.Tables("Events").Rows(DataGridView.CurrentRow.Index).Item("Days"))
Then the DatagridView Displays the data correctly. If the user changes the sort in the DataGridView the Data I want to retrieve from the DataGridView is messed up. So I have two questions.
1. How can I sort my DataSet when the sort changes on the DataGridView
2. How do I disable the sort on the DataGridView
Thanks
ZeroEffect
Last edited by a moderator: