Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > datagrid itemIndex cell reference

Reply
Thread Tools

datagrid itemIndex cell reference

 
 
janetb
Guest
Posts: n/a
 
      05-10-2006
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find ItemIndex given DataKey in DataGrid Rod ASP .Net 2 03-09-2007 02:25 PM
DataGrid change ItemIndex chandy@totalise.co.uk ASP .Net 1 01-06-2006 04:19 PM
DATASET DATAGRID ITEMINDEX DATASETINDEX Jose Fernandez ASP .Net Web Controls 4 06-01-2005 03:08 PM
ItemIndex is -1 in ItemCommand after selecting page in DataGrid Alan Eilers ASP .Net Datagrid Control 1 05-12-2004 11:17 PM
How to refer to linkbutton in datagrid using ItemIndex? susie ASP .Net Web Controls 0 09-29-2003 09:45 PM



Advertisments