Hi Everyone
I'm having an issue deleting a row in the radgrid. I have gone through the samples, but they don't help...
My javaScript for the delete (which happens on 'RowSelect') is:
function RowSelected(sender, args) {
var DocumentManagementID = args.getDataKeyValue("DocumentManagementID");
var SCID = args.getDataKeyValue("SCID");
var table = sender.get_masterTableView().get_element();
var currentRowIndex = args.get_gridDataItem().get_element().rowIndex;
var row = table.rows[currentRowIndex];
table.deleteRow(currentRowIndex);
var tURL = 'frmSingleCapture_SupervisorVerification_ViewApp.aspx?DocumentManagementID=' + DocumentManagementID + '&SCID=' + SCID + '&SC=Yes'
window.open(tURL);
}
if you add alerts to the various var declarations, they all return items (table returns an [object] message) until current row.
agrs.get_gridDataItem() is null and the currentRowIndex therefore does not populate...
What am i doing wrong?
My grid itself looks as follows:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="dsApproveCapture" GridLines="None" Skin="Sunset">
<ClientSettings>
<Selecting AllowRowSelect="true" />
<Scrolling AllowScroll="true" />
<ClientEvents OnRowSelected="RowSelected" />
</ClientSettings>
<PagerStyle Mode="Advanced" />
<MasterTableView DataKeyNames="DocumentManagementID" DataSourceID="dsApproveCapture" ClientDataKeyNames="DocumentManagementID, SCID">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn DataField="DocumentManagementID" DataType="System.Int32" HeaderText="Doc ID" ReadOnly="True" SortExpression="DocumentManagementID" UniqueName="DocumentManagementID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="SCID" DataType="System.Int32" HeaderText="Capture ID" ReadOnly="True" SortExpression="SCID" UniqueName="SCID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FirstInsertedDate" DataType="System.DateTime" HeaderText="First inserted date" SortExpression="FirstInsertedDate" UniqueName="FirstInsertedDate" DataFormatString="{0:dd MMM yyyy, HH:mm:ss}">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="SchemeName" HeaderText="Scheme name" SortExpression="SchemeName" UniqueName="SchemeName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ApplicationReference" HeaderText="Application reference" SortExpression="ApplicationReference" UniqueName="ApplicationReference">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="FullName" HeaderText="Capturer" SortExpression="FullName" UniqueName="FullName">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>