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

A

AlainCD

Hello,

System:
- Datagrid, web form with the function:
OnItemCommand (byval sender as Object, byval e as
DataGridCommandEventArgs)
Integration:
- 2 Columns:
* First column: ButtonColumn with text.
* Second column: BoundColumn with integer.
Result Display N°1: Data unsorted
Text1 5
Text2 3
Text3 4
Result display N°2: Data sorted by second column by clicking on header
datagrid
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 N°2=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
Text1.

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
problem.
AlainCD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top