datagrid itemIndex cell reference

Discussion in 'ASP .Net Web Controls' started by janetb, May 10, 2006.

  1. janetb

    janetb Guest

    I'm making first, last, next, prev buttons that are outside of the datagrid.
    The labels/buttons that are assigned value/commands respectively based on
    which row of the datagrid is selected (which only needs to have dataBind on
    the first page load). Then, if the button outside the datagrid is pushed, I
    want it to go to the correct row of the datagrid and display a hidden cell of
    the datagrid in a label field. What is the correct syntax for pulling a
    datagrid's hidden column based on a button click outside of the datagrid? If
    you look at the code below, the correct row in the datagrid is highlighted
    when I push the next button, but I can't get the syntax right to have the
    lblPgTitle display the hidden cell of the datagrid. (datagrid cell
    specifically is DataField="pgTitle")

    sub pgNext(sender as object, e as eventArgs)
    dim n as integer=cint(lblNext.text)
    dgNavList.selectedIndex=n
    lblPgTitle.text=dgNavList.item.cells(1).text
    end sub

    Tried another tack going through the onSelectedItemChanged in the datagrid
    with:

    Sub navNav(Sender as object, e as eventArgs)
    Dim itemTitle As TableCell =
    dgNavList.Items[dgNavList.SelectedIndex].Cells(1)
    lblPgTitle.text=convert.toString(itemTitle.text)
    End sub

    but get an error of identifer expected.

    Any ideas? There's got to be a way to reference it.
    Janet
     
    janetb, May 10, 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. DataGrid change ItemIndex

    , Jan 5, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    492
    S. Justin Gengo
    Jan 6, 2006
  2. Rod
    Replies:
    2
    Views:
    861
  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:
    242
    Scott Mitchell [MVP]
    May 13, 2004
  4. susie
    Replies:
    0
    Views:
    150
    susie
    Sep 29, 2003
  5. Jose Fernandez

    DATASET DATAGRID ITEMINDEX DATASETINDEX

    Jose Fernandez, May 25, 2005, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    281
    Jose Fernandez
    Jun 1, 2005
Loading...

Share This Page