Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > DataGrid. How to keep the right keyfield value when Sort the DataGrid?

Reply
Thread Tools

DataGrid. How to keep the right keyfield value when Sort the DataGrid?

 
 
Eugene
Guest
Posts: n/a
 
      09-28-2004
Hi everybody!

Got the logical error (wrong row (SSN) selected on
SelectedIndexChange event) when made a sort by non-key field in
Datagrid.

Used this Sub to keep the keyfield ("SSN"):

Private Sub dgrMain_SelectedIndexChanged(ByVal sender As
System.Object,ByVal e As System.EventArgs) Handles
dgrMain.SelectedIndexChanged
Session("SSN") =
dgrMain.Items(dgrMain.SelectedIndex).Cells(1).Text
Response.Redirect("Default.aspx")
End Sub

Did sorting in a standart way. Everything works fine when the Grid is
sorted by SSN (what is cells(1)). But when you sort by any other field
it still choose the row like sorted by SSN.
Thanks for the help.
Eugene
 
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
How keep python socket alive for ever by setting Keep alive flag. hisan Python 1 06-25-2012 05:30 PM
Sorting on a DataField (not KeyField) Xarky ASP .Net Datagrid Control 2 04-12-2005 06:01 AM
read keyfield value from selected row in datagrid mharness ASP General 2 10-11-2004 11:58 AM
read keyfield value from selected row in datagrid mharness ASP .Net Datagrid Control 0 10-11-2004 11:55 AM
Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. Navin ASP General 1 09-09-2003 07:16 AM



Advertisments