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?
ADAdministrator Syncfusion Team January 28, 2005 02:37 AM
You can hide a row using grid.Model.Rows.Hidden.
//hide row 2
this.gridDataBoundGrid1.Model.Rows.Hidden = true;
JEJose EgeaJanuary 28, 2005 03:13 AM
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?
ADAdministrator Syncfusion Team January 28, 2005 04:03 AM
You change change the current position (where the header triangle is) by setting grid.Binder.CurrentPosition property.
JEJose EgeaJanuary 28, 2005 05:00 AM
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
ADAdministrator Syncfusion Team January 28, 2005 05:17 AM
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.
JEJose EgeaFebruary 14, 2005 12:41 PM
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?
ADAdministrator Syncfusion Team February 14, 2005 03:21 PM
You can prevent the doubleclick from resizing and showing the columns by handling the ResizingColumns event.