How to refer to linkbutton in datagrid using ItemIndex?

Discussion in 'ASP .Net Web Controls' started by susie, Sep 29, 2003.

  1. susie

    susie Guest

    I have another issue coming up after I am able to sort the
    records in asc and desc.
    The sorting function is created in master sheet.
    The first column were created as linkbuttons and will not
    be sorted.
    The following code is for the first column linked button.
    Sub Master_ItemCommand( s As Object, e As
    DataGridCommandEventArgs )
    intJobNum=Master.DataKeys(e.Item.ItemIndex)
    Master.SelectedIndex = e.Item.ItemIndex
    BindDetailGrid
    End Sub

    However I found that the above function(or sub routine)
    interfers with sort functions.
    I am no long able to use the sorting function unless I
    comment out the above sub routine.
    It seems like that ItemIndex referred to all the linked
    items in the master sheet since sorting function turn the
    headings into linked items.
    How can refer to the Item in the first column(linked
    button column) only in my Master_ItemCommand ?

    I can not use Cells(0).Controls(1) directedly because cell
    is not an item in DataGrid.
    Do you have any suggestions?
    susie, Sep 29, 2003
    #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. DataGrid change ItemIndex

    , Jan 5, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    489
    S. Justin Gengo
    Jan 6, 2006
  2. Rod
    Replies:
    2
    Views:
    859
  3. Alan Eilers

    ItemIndex is -1 in ItemCommand after selecting page in DataGrid

    Alan Eilers, May 12, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    238
    Scott Mitchell [MVP]
    May 13, 2004
  4. Jose Fernandez

    DATASET DATAGRID ITEMINDEX DATASETINDEX

    Jose Fernandez, May 25, 2005, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    279
    Jose Fernandez
    Jun 1, 2005
  5. janetb

    datagrid itemIndex cell reference

    janetb, May 10, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    169
    janetb
    May 10, 2006
Loading...

Share This Page