Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
<
telerik:GridTemplateColumn
>
ItemTemplate
asp:CheckBox
ID
=
"CheckBox1"
runat
"server"
OnCheckedChanged
"CheckBox1_CheckedChanged"
AutoPostBack
"true"
/>
</
protected
void
RadGrid1_ItemCreated(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
GridDataItem item = (GridDataItem)e.Item;
CheckBox chkbox = (CheckBox)item.FindControl(
);
int
index = item.ItemIndex;
//getting the index
chkbox.Attributes.Add(
"onclick"
,
"clickEvent('"
+ index +
"');"
//attaching client events from server side
}
<script type=
"text/javascript"
function
clickEvent(index)
alert(index);
</script>
CheckBox1_CheckedChanged(
sender, EventArgs e)
CheckBox chkbox = sender
as
CheckBox;
GridDataItem item = (GridDataItem)(sender
CheckBox).NamingContainer;
string
emp = item[
"ColumnUniqueName"
].Text.ToString();