S
Sinan
Hi
I am using a datagrid with a Select Column and the SelectedIndexChanged event captures the values of the cells in the selected row.
It works fine before sorting any column. The problem starts when I sort a column and then select a row, it gives me the data of another row! Not the row I have selected
Any idea what is going wrong? Your help is highly appreciated
Here is the sort procedure I am using
"Private Sub DataGrid1_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles DataGrid1.SortComman
strSql = "select * from dvSTD1 order by " &
e.SortExpression.ToString(
Dim objConn As New SqlConnection(strConnTxt
objConn.Open(
Dim objCmd As New SqlCommand(strSql, objConn
DataGrid1.DataSource = objCmd.ExecuteReader(
DataGrid1.DataBind(
objConn.Close(
End Sub"
I am using a datagrid with a Select Column and the SelectedIndexChanged event captures the values of the cells in the selected row.
It works fine before sorting any column. The problem starts when I sort a column and then select a row, it gives me the data of another row! Not the row I have selected
Any idea what is going wrong? Your help is highly appreciated
Here is the sort procedure I am using
"Private Sub DataGrid1_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles DataGrid1.SortComman
strSql = "select * from dvSTD1 order by " &
e.SortExpression.ToString(
Dim objConn As New SqlConnection(strConnTxt
objConn.Open(
Dim objCmd As New SqlCommand(strSql, objConn
DataGrid1.DataSource = objCmd.ExecuteReader(
DataGrid1.DataBind(
objConn.Close(
End Sub"