Deleting or hiding a row in a collection
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?
SIGN IN To post a reply.
7 Replies
AD
Administrator
Syncfusion Team
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;
JE
Jose Egea
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?
AD
Administrator
Syncfusion Team
January 28, 2005 09:03 AM UTC
You change change the current position (where the header triangle is) by setting grid.Binder.CurrentPosition property.
JE
Jose Egea
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
AD
Administrator
Syncfusion Team
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.
JE
Jose Egea
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
AD
Administrator
Syncfusion Team
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)
{
if(e.Reason.Equals(GridResizeCellsReason.DoubleClick))
{
e.Cancel = true;
}
}
SIGN IN To post a reply.
- 7 Replies
- 2 Participants
-
JE Jose Egea
- Jan 28, 2005 07:32 AM UTC
- Feb 14, 2005 08:21 PM UTC