<CommandItemTemplate>
<table width="35%">
<tr>
<td><asp:LinkButton ID="ButtonEditAll" runat="server" Text="Edit All"
CommandName="EditAll" /></td>
<td><asp:LinkButton ID="ButtonUpdateAll" runat="server" Text="Update All"
CommandName="UpdateAll" /></td>
<td>
<asp:LinkButton ID="DownloadPDF" runat="server" Text="Download"
CommandName="ExportToPdf" /></td>
</tr>
</table>
</CommandItemTemplate>
and I waht to check spelling after clicking this button. But I don't know how to get these buttons client ids. Please give me a help.
Thanks
5 Answers, 1 is accepted

I am not quite sure about the requirement and I suppose you want to execute some client side code when clicking the LinkButtons. If that is the case you can directly attach the client side event and write the code there.
aspx:
<
td
>
<
asp:LinkButton
ID
=
"ButtonEditAll"
OnClientClick
=
"CheckSpelling();"
runat
=
"server"
Text
=
"Edit All"
CommandName
=
"EditAll"
/>
</
td
>
function
CheckSpelling()
{
//your code here
}
If this is not your case, please elaborate the scenario.
Thanks,
Shinu

Thanks

If you want to get the LinkButton from client side, try the following code snippet.
ASPX:
<
CommandItemTemplate
>
<
asp:LinkButton
ID
=
"ButtonEditAll"
runat
=
"server"
Text
=
"Edit All"
CommandName
=
"EditAll"
/>
<
asp:LinkButton
ID
=
"ButtonUpdateAll"
runat
=
"server"
Text
=
"Update All"
CommandName
=
"UpdateAll"
/>
</
CommandItemTemplate
>
C#:
protected
void
RadGrid1_ItemCreated(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridCommandItem)
{
GridCommandItem cmdItem = (GridCommandItem)e.Item;
LinkButton editbtn = (LinkButton)cmdItem.FindControl(
"ButtonEditAll"
);
LinkButton updatebtn = (LinkButton)cmdItem.FindControl(
"ButtonUpdateAll"
);
editbtn.Attributes.Add(
"onclick"
,
"CheckSpelling(this,'"
+ updatebtn.ClientID +
"');"
);
}
}
Java Script:
<script type=
"text/javascript"
>
function
CheckSpelling(editbtn, updatebtn) {
var
updatebutton = document.getElementById(updatebtn);
//accessing Update LinkButton
}
</script>
Hope this helps,
-Shinu.

I add spelling check to "update all" and it works, and speeling check "update" button at a grid row and it works fine too. But when user clicks "edit all" button, all rows in edit mode. "Hidden" controls are needed for each row to hold "update" button client id, and radajaxmanager needs to add <ajaxsettings> dynamically too. I want to check with you the way I try to code is right, and please provide me some sample code to accomplish it.
Thanks
I have followed your scenario and prepared a sample project for you demonstrating how the desired functionality can be implemented. You can find it attached to this message.
I hope it helps.
Kind regards,
Mira
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.