Greetings,
I have a GridTemplateColumn on my grid :
When i click on it,the program goes here to send the ID of the row:
BUT when i try to insert a new record on my grid, the program goes also here and create an ArgumentOutofRangeException
basically, it says : the index is out of range. Must be non-negative and less than the size of the collection. Parameter name: index
Can anyone help me ? thanks in advance
I have a GridTemplateColumn on my grid :
<
telerik:GridTemplateColumn
UniqueName
=
"TemplateEditColumn"
>
<
ItemTemplate
>
<
asp:HyperLink
ID
=
"EditLink"
runat
=
"server"
Text
=
"Participants"
></
asp:HyperLink
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
When i click on it,the program goes here to send the ID of the row:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");
editLink.Attributes["href"] = "#";
editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["idRDV"], e.Item.ItemIndex);
}
}
BUT when i try to insert a new record on my grid, the program goes also here and create an ArgumentOutofRangeException
basically, it says : the index is out of range. Must be non-negative and less than the size of the collection. Parameter name: index
Can anyone help me ? thanks in advance