Home All Groups Group Topic Archive Search About

Accessing Datagrid Cells on OnClick Postback

Author
12 Jan 2006 9:22 PM
John Walker
Hi,
I have a datagrid which has a link button template column.  In the 'on
click' event of this link button - which does a postback - I need to
reference the value of another control on the same row on which the link
button was clicked.  Is there an easy way to do that?
Thanks,
John

Author
12 Jan 2006 9:41 PM
Phillip Williams
Protected Sub DataGrid1_Command(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs) Handles datagrid1.ItemCommand
        'use the e.Item.Cells collection to refer to any column on this row
        'use the e.Item.FindControl (ControlID) to find a named control
within a template
End Sub
Show quoteHide quote
"John Walker" wrote:

> Hi,
> I have a datagrid which has a link button template column.  In the 'on
> click' event of this link button - which does a postback - I need to
> reference the value of another control on the same row on which the link
> button was clicked.  Is there an easy way to do that?
> Thanks,
> John