But i keep getting 'btnContainer' does not exist in the current context.
How do i get it's id?
jquery:
document.getElementById(
'<%= btnContainer.ClientID %>'
)
radgrid:
<telerik:GridTemplateColumn>
<ItemTemplate>
<asp:LinkButton ID="btnContainer" class="ActionMenuButton" runat="server" >Actions</asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
8 Answers, 1 is accepted

You can access the controls in ItemTemplate using findElement as shown below.
Javascript:
<script type=
"text/javascript"
>
function
ButtonClick()
{
var
grid = $find(
"<%=RadGrid1.ClientID %>"
);
var
masterTable = grid.get_masterTableView();
var
row = masterTable.get_dataItems();
var
button = row.findElement(
"btnContainer"
);
}
</script>
Thanks,
Princy

Error: Object doesn't support property or method 'findElement'
findElement method is part of the item object and not of the items array:
var row = masterTable.get_dataItems()[0];
var
button = row.findElement(
"btnContainer"
);
GridDataItem Class Members
Regards,
Daniel
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.

row.findElement(
"btnContainer"
).click();
<
asp:LinkButton
ID
=
"btnContainer"
class
=
"ActionMenuButton"
runat
=
"server"
CommandName='<%#Eval("formID") + "," + Eval("isPublished")%>' OnCommand="action_Command">Actions</
asp:LinkButton
>
This code works fine on my end.
I created a simple demo based on these snippets. Please test it locally and see if I'm missing something.
Best regards,
Daniel
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.

Thanks, seems to work but I'm needing to get the values from each row. How would I go about doing something like that? Here is what my action_Command looks like:
protected void action_Command(object sender, CommandEventArgs e)
{
string[] values = e.CommandName.Split(',');
Globals.FormID = Convert.ToInt32(values[0]);
Globals.IsPublished = values[1];
Label1.Text = Globals.FormID + "";
Label2.Text = Globals.IsPublished;
}
I merged your code to my previous demo and added logic to display the values for each row.
Hope this helps.
Regards,
Daniel
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

On textchanged event of a textbox I want to loop through the radgrid using Jquery/JavaScript, sum up all the three textboxes and display it in the fourth textbox of the corresponding row..
Is there a solution?