datagrid itemIndex cell reference

J

janetb

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
 

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

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,830
Latest member
HeleneMull

Latest Threads

Top