Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > [Datagrid,web form]: How the get the correct row values after sorting datagrid by header

Thread Tools

[Datagrid,web form]: How the get the correct row values after sorting datagrid by header

Posts: n/a

- Datagrid, web form with the function:
OnItemCommand (byval sender as Object, byval e as
- 2 Columns:
* First column: ButtonColumn with text.
* Second column: BoundColumn with integer.
Result Display N1: Data unsorted
Text1 5
Text2 3
Text3 4
Result display N2: Data sorted by second column by clicking on header
Text2 3
Text3 4
Text1 5

Before I sort, if I clic on the button column of the third row, I get the
correct values in OnItemCommand function by using the e.Item.ItemIndex=3,
and DirectCast(e.CommandSource, LinkButton).Text gives Text3=OK.

Now if I sort on the second column by clicking on the datagrid header, I get
the result display N2=fine. But if I clic on the buttoncolumn of the third
row, the e.Item.ItemIndex is correct and gives 3, but
DirectCast(e.CommandSource, LinkButton).Text gives always Text3 AND NOT

Then, how can I get the correct row values after sorting the Datagrid by
clicking on an header?

Note: I don't use win form and I havent found anything now that resolves my

Reply With Quote

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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
datagrid having row header and column header ASP .Net Datagrid Control 0 07-13-2006 08:20 AM
ok I can do a totals row but how about a percentage row after each data row D ASP .Net Datagrid Control 0 05-23-2005 04:10 PM
How to add a new row to a datagrid with values of the selected row =?Utf-8?B?U3VyZXNo?= ASP .Net 1 11-22-2004 09:04 AM
Sorting DataGrid after Row Data Changed jdn ASP .Net Web Controls 1 11-15-2004 05:13 PM