This is a migrated thread and some comments may be shown as answers.

How can I access a linkbutton in a gridtemplate column?

1 Answer 311 Views
Grid
This is a migrated thread and some comments may be shown as answers.
fred williams
Top achievements
Rank 1
fred williams asked on 13 Dec 2010, 04:00 PM
So I have a grid with a template column, and that column has  alinkbutton in it:
<telerik:RadGrid ID="rgCSVTest" runat="server" AllowPaging="true" Visible="false">
      <MasterTableView>
          <Columns>
          <telerik:GridTemplateColumn HeaderText="Edit" UniqueName="tmpEdit">
              <ItemTemplate>
                  <asp:LinkButton ID="btnTmpEdit" runat="server" CommandName="Edit" Text="Edit" />
              </ItemTemplate>
          </telerik:GridTemplateColumn>
I'd like to be able to access the "btnTmpEdit" linkbutton, so I can add an "onmouseover" and "onmouseout" event to trigger a popup when the user hovers over it. I know how to add the client-side events, I just need to know how I can access this button in codebehind? is this possible? Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 13 Dec 2010, 04:08 PM
Hi Fred,

For template columns you must find the control in the grid cell and extract its value. You need to access the GridDataItem and get reference to control using the FindControl(controlID) method. More information is available here:
http://www.telerik.com/help/aspnet-ajax/grdaccessingcellsandrows.html

Regards,
Pavlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
fred williams
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or