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

cell events

{this.txtPreview.Text = this.Collection.Expression; this.txtPreview.Text = this.BuildingExpression; if(e.Range.Right == 3) { this.grdFilter.RowCount = this.grdFilter.RowCount + 1; } Kindly refer the code above , I have written the above code inside the grd_cellschanged event. The code block throws the stack overflow exception. The exception is because the rowcount change calls the cellschanged event again."e" is of GridCellsChangedEventArgs type. Requirement: The grid has 3 cols. The no of rows is variable. I want to add an new row to the grid after the contents of 3rd col have been cahnged in every row.

1 Reply

AD Administrator Syncfusion Team May 6, 2005 04:06 AM

Do you want to add the new row as your user leaves the cell in column 3 after changing its value? If so, try doing it in the CurrentCellvalidating event.
private void gridControl1_CurrentCellValidating(object sender, CancelEventArgs e)
{
	GridCurrentCell cc = this.gridControl1.CurrentCell;
	if(cc.ColIndex == 3)
	{
		cc.Lock();
		this.gridControl1.RowCount += 1;
		cc.Unlock();
	}
}

Loader.
Live Chat Icon For mobile
Up arrow icon