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

Discussion in 'ASP .Net Datagrid Control' started by AlainCD, Jan 12, 2006.

  1. AlainCD

    AlainCD Guest

    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
     
    AlainCD, Jan 12, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U3VyZXNo?=
    Replies:
    1
    Views:
    484
    Saravana
    Nov 22, 2004
  2. Luis Esteban Valencia

    Make a DataGrid row editable after user selects the row

    Luis Esteban Valencia, Jan 12, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    363
    Luis Esteban Valencia
    Jan 12, 2005
  3. D
    Replies:
    0
    Views:
    254
  4. datagrid having row header and column header

    , Jul 13, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    197
  5. jdn

    Sorting DataGrid after Row Data Changed

    jdn, Nov 15, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    135
Loading...

Share This Page