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

Deleting the contents of a cell in databoundgrid

Hi, 'im using a databoudn grid, when i press the delete i want the contents of the currently selected cell to be cleared. Until now it deleted the entire row. I solved that by canceling the rowsdeleting event, but now i want the selected cell to be cleared. I tried using the currentcell and setting its value to an empty string, this worked, but when i do it on the last row real roow (not the empty one added) then it creates another empty line. Any ideas? Kind regards Dave

1 Reply

AD Administrator Syncfusion Team October 17, 2003 08:26 AM UTC

Try ClearCells instead.
private void gridDataBoundGrid1_RowsDeleting(object sender, GridRowRangeEventArgs e)
{
	e.Cancel = true;
	GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
	this.gridDataBoundGrid1.Model.ClearCells(cc.RangeInfo, false);
}    

Loader.
Up arrow icon