We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Delete a row in the record

private void butDelete_Click(object sender,EventArgs e)
{
if (grdDisplayItems.Table.CurrentRecord != null)
{
if (grdDisplayItems.Table.Records.Count == 1)
{
grdDisplayItems.Table.Records[0].Delete();
}
else
{
this.grdDisplayItems.Table.CurrentRecord.Delete();
}
//this.grdDisplayItems.Table.Records[0].Delete();
}
}
The delete method deletes all records except for the record that iis left out.for e if we have 4 records it deletes 3 records succesfully but the last record is not deleted at all


if the grid has just one record then also the record is not getting deleted
I am getting an exception object refrence not set to an instanc eof an object

Stack trace:
StackTrace " at System.Data.DataView.GetRow(Int32 index)\r at System.Data.DataView.System.Collections.IList.RemoveAt(Int32 index)\r at Syncfusion.Grouping.Table.DeleteRecord(Record r)\r at Syncfusion.Grouping.Record.Delete()" string



1 Reply

BM Bharath M Syncfusion Team October 11, 2010 05:54 PM UTC

Hi Harshini,

We regret for the inconvenience caused.

I am afraid that I am unable to reproduce the reported issue. Could you please update us the type of data that you are binding to grid and if possible, please provide us full grid definition from both ASPX and CS?

Let me know if you have any concerns.

Regards,
Bharath M




Loader.
Live Chat Icon For mobile
Up arrow icon