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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Deleting or hiding a row in a collection

Thread ID:





24104 Jan 28,2005 07:32 AM UTC Feb 14,2005 08:21 PM UTC WinForms 7
Tags: GridControl
Jose Egea
Asked On January 28, 2005 07:32 AM UTC

I''m using a IBinding collection with the GDBG. I want to mark the item in the collection as isdeleted when the user press the delete button. Using the RemoveRange method the item is removed from the collection and I can''t catch it in my Save method. How can I hide or delete the row in the grid, not in the collection, until I use my Save method?

Administrator [Syncfusion]
Replied On January 28, 2005 07:37 AM UTC

You can hide a row using grid.Model.Rows.Hidden. //hide row 2 this.gridDataBoundGrid1.Model.Rows.Hidden[2] = true;

Jose Egea
Replied On January 28, 2005 08:13 AM UTC

Thanks. It works, but I lose the cursor in the grid and it''s still pointing to the same row. This way if I try to edit the current record after deleting it pops up the deleted row. Is there a better way? or how can I manage the cursor pointing to next, previous if last, ... row?

Administrator [Syncfusion]
Replied On January 28, 2005 09:03 AM UTC

You change change the current position (where the header triangle is) by setting grid.Binder.CurrentPosition property.

Jose Egea
Replied On January 28, 2005 10:00 AM UTC

But Clay, how can I know the previous or next visible position? because it can be hidden too. And the grid can be resorted. Thanks in advance for your help

Administrator [Syncfusion]
Replied On January 28, 2005 10:17 AM UTC

You can loop through grid.Rows.Hidden until you find a False value. This will give you the grid RowIndex of the next or previous visible row (depending how how you run your loop). You can then call grid.Binder.RowIndexToPosition to get the position value, and then set this value into grid.Binder.CurrentPosition.

Jose Egea
Replied On February 14, 2005 05:41 PM UTC

Hello: I have done it this way and it works. But today I have discovered that I can make a hidden row visible with a double click below the triangle header in the previous visible row, you know, in the separator header line between two visible rows where I have hidden my row. How can I solve that? Best regards

Administrator [Syncfusion]
Replied On February 14, 2005 08:21 PM UTC

You can prevent the doubleclick from resizing and showing the columns by handling the ResizingColumns event.
private void gridControl1_ResizingColumns(object sender, GridResizingColumnsEventArgs e)
		e.Cancel = true;


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon