Hello!
I get the following error when double clicking on the grid row or clicking the edit button in the row, which I want to edit in place:
System.ArgumentOutOfRangeException: The specified argument is out of range
Argument name: index
It is not an ajax failure, because it also happens out of a update panel. My code is inspired from the demo here: http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx
My code looks like this (the "important" part):
I get the following error when double clicking on the grid row or clicking the edit button in the row, which I want to edit in place:
System.ArgumentOutOfRangeException: The specified argument is out of range
Argument name: index
It is not an ajax failure, because it also happens out of a update panel. My code is inspired from the demo here: http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx
My code looks like this (the "important" part):
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> function RowDblClick(sender, eventArgs) { sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical()); } </script> </telerik:RadCodeBlock> <telerik:RadGrid ID="rgKalkulation" runat="server" AutoGenerateEditColumn="false" AutoGenerateDeleteColumn="false" OnNeedDataSource="rgKalkulation_NeedDataSource" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" PageSize="10" AllowAutomaticUpdates="True" OnDeleteCommand="rgKalkulation_DeleteCommand" OnInsertCommand="rgKalkulation_InsertCommand" OnUpdateCommand="rgKalkulation_UpdateCommand" OnItemDataBound="rgKalkulation_OnItemDataBound"> <MasterTableView CommandItemSettings-RefreshText="" CommandItemDisplay="Bottom" AutoGenerateColumns="false" Font-Size="8pt" Font-Names="Verdana" runat="server" NoMasterRecordsText="Keine Datensätze vorhanden." InsertItemDisplay="Bottom" CommandItemSettings-AddNewRecordText="Datensatz hinzufügen" EditMode="InPlace" ShowGroupFooter="true" DataKeyNames="id"> <GroupByExpressions> <telerik:GridGroupByExpression> <SelectFields> <telerik:GridGroupByField HeaderText="Art.-Gr." FieldName="artgrkopf"></telerik:GridGroupByField> </SelectFields> <GroupByFields> <telerik:GridGroupByField FieldName="artgr" SortOrder="Ascending"></telerik:GridGroupByField> </GroupByFields> </telerik:GridGroupByExpression> </GroupByExpressions> <Columns> <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"> <ItemStyle CssClass="MyImageButton" /> </telerik:GridEditCommandColumn> <telerik:GridBoundColumn DataField="artgr" HeaderText="ArtGr" UniqueName="artgr" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="artbzl" HeaderText="Artikelbezeichnung" DefaultInsertValue="" UniqueName="artbzl" FooterText="Anzahl Artikel" Aggregate="Count"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="herstellerbezeichnung" HeaderText="Herstellerbezeichnung" DefaultInsertValue="" UniqueName="herstellerbezeichnung"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="artext" HeaderText="Art.-Nr." DefaultInsertValue="" UniqueName="artext"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="palettengewicht" HeaderText="Palettengewicht" DefaultInsertValue="" UniqueName="palettengewicht"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="mdevsx" HeaderText="Inhalt" DefaultInsertValue="" UniqueName="mdevsx"> </telerik:GridBoundColumn> <telerik:GridNumericColumn HeaderText="Absatz (to)" DataField="absatz" ColumnEditorID="GridNumericColumnEditor1" UniqueName="absatz"> </telerik:GridNumericColumn> <telerik:GridNumericColumn HeaderText="Nettoumsatz (T€)"> </telerik:GridNumericColumn> <telerik:GridNumericColumn HeaderText="Bruttoerlös (alt)"> </telerik:GridNumericColumn> <telerik:GridNumericColumn HeaderText="Nettoerlös (alt)"> </telerik:GridNumericColumn> <telerik:GridNumericColumn HeaderText="Bruttoerlös (neu)"> </telerik:GridNumericColumn> </Columns> </MasterTableView> <ClientSettings> <Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="650px" /> <ClientEvents OnRowDblClick="RowDblClick" /> </ClientSettings> </telerik:RadGrid> <telerik:GridNumericColumnEditor ID="GridNumericColumnEditor1" runat="server"> </telerik:GridNumericColumnEditor>
I need (quick) help please, because tomorrow I have a meeting where I have to present this.
Kind regards
Michael