Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Sorting Datagrid with a Select Column - Does not work!

Reply
Thread Tools

Sorting Datagrid with a Select Column - Does not work!

 
 
Sinan
Guest
Posts: n/a
 
      01-28-2005
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.DataGridSortCommandEvent Args) 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"

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView - Setting the text of the 'select' column to the value of another column Greg Smith ASP .Net 0 04-12-2007 03:11 PM
GridView - Setting the text of the 'select' column to the value of another column Greg Smith ASP .Net Web Controls 0 04-12-2007 02:40 PM
Sortable column on DataGrid -- column header not displaying Teej ASP .Net Datagrid Control 2 08-15-2006 06:23 PM
bind a dropdown in a column in a datagrid based on the dropdown value selected in another column of the datagrid. vishnu ASP .Net 1 03-25-2006 01:24 PM
how do i access a dropdownlists selected value in a datagrid edititemtemplate column from the selectedindexchanged event of another dropdownlist in a datagrid edititemtemplate column Dave M ASP .Net Datagrid Control 0 12-14-2004 11:53 AM



Advertisments