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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Manual Delete row from GridControl does not work

Thread ID:

Created:

Updated:

Platform:

Replies:

45344 Jun 18,2006 01:34 AM UTC Jun 19,2006 03:38 PM UTC WinForms 2
loading
Tags: GridControl
jamesb
Asked On June 18, 2006 01:34 AM UTC

I have a GridControl which i populate manually. I have a button on the form the add a row at the end. I also have a button that tries to remove this last row. My problem is that the add row works, but the remove row does nothing. What gives? I am new to this grid and need some help. Also, Is there any documentation on the sequence of events? private void buttonAdd_Click(object sender, EventArgs e) { int rowIndex = this.gridControl.RowCount + 1; this.gridControl.Model.Rows.InsertRange(rowIndex, 1); } private void buttonDelete_Click(object sender, EventArgs e) { int rowIndex = this.gridControl.RowCount; this.gridControl.Model.Rows.RemoveRange(rowIndex, 1); }

Administrator [Syncfusion]
Replied On June 19, 2006 03:34 PM UTC

Hi Jamesb, Try this code to remove the last row in a grid. Here is a code snippet. int rowIndex = this.gridControl1.RowCount; this.gridControl1.BeginUpdate(); this.gridControl1.RowCount -= 1; this.gridControl1.EndUpdate(true); Let me know if this helps. Best Regards, Haneef

Administrator [Syncfusion]
Replied On June 19, 2006 03:38 PM UTC

Hi James, In the Rows.RemoveRange() the first row index and the last row index of the range that you want to delete should be passed as argument. Below is a code snippet to delete the last row. int rowIndex = this.gridControl1.RowCount; this.gridControl1.Model.Rows.RemoveRange(rowIndex-1, rowIndex-1); Regards, Calvin.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;