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

"Deactivate called while current cell was in process of activating or deactivating a cell" Problem

Hi, I am running the following code to control the pop-up of the custom filter dialog again and again on the click on the grid. private void grdDomainSync_CurrentCellAcceptedChanges(object sender, System.ComponentModel.CancelEventArgs e) { GridCurrentCell cc = this.grdDomainSync.CurrentCell; if(cc.RowIndex==1) { this.grdDomainSync.CurrentCell.ResetCurrentCellWithoutDeactivate(); cc.MoveTo(this.grdDomainSync.Model.Rows.FrozenCount+1,cc.ColIndex); this.grdDomainSync.Binder.CurrentPosition=0; } } In the grid, they are 6 columns,when the select the custom filter dialog for the first time it is working well. second time when i select the custom filter dialog, the above code is executing, it is seen by placing a break point at the start of the above code. third time if i select the third column in the series, then i am getting the error message as "Deactivate called while current cell was in process of activating or deactivating a cell". pls. suggest a solution for the above problem. Thanks in Advance, logicengineer.

5 Replies

AD Administrator Syncfusion Team June 20, 2004 04:13 PM UTC

You usually get this particular type of error when you explicitly call CurrentCell.MoveTo while the grid is already in the process of another MoverTo (deactivating and activating a cell). Why are you trying to call CurrentCell.MoveTo in CurrentCellAcceptedChanges? I think the solution will be to resolve the problem which you are trying to avoid by calling CurrentCell.MoveTo in this event. Can you see this original problem in our FilterBar sample when it displays a custom dialog?


UK Umesh Kumar June 20, 2004 05:07 PM UTC

Hi Clay, Thanks for the response. Actually in the application, when the columns are created on the fly connected to the database, when i tranverse from one combinations of cloumns on the GDBG to the another,I got a problem in the custom filter dialog that only once after custom filtering whenever I click on the grid this custom filter started popping up again and again as a result, in the above event i am trying to change the focus from the filter row to another, so that the custom filter dialog pop-up can be avoided. but now i am getting the above mentioned problem. How to solve this problem. Actually, i want to know if i create a filter using the three lines of code given in the user guide in the first run it is not giving the problem, if i switch to another combination of coulmns and want to do custom filtering, what are the things that should be done to work the filter without any problems. Is there any filter events that can be used in the programming, as it is observed that in version 1.6.1.8 there are no events associated with the filter bar. How to capture the above error "Deactivate called while current cell was in process of activating or deactivating a cell" and how it can be displayed onto the status panel bar rather than a message box. pls. suggest how to overcome this type of problems. Thanks in advance, logicengineer. >You usually get this particular type of error when you explicitly call CurrentCell.MoveTo while the grid is already in the process of another MoverTo (deactivating and activating a cell). > >Why are you trying to call CurrentCell.MoveTo in CurrentCellAcceptedChanges? I think the solution will be to resolve the problem which you are trying to avoid by calling CurrentCell.MoveTo in this event. > >Can you see this original problem in our FilterBar sample when it displays a custom dialog?


AD Administrator Syncfusion Team June 20, 2004 09:20 PM UTC

I would try this. To change the columns in your grid, 1) call grid.BeginUpdate() 2) call grid.CurrentCell.MoveTo(-1,-1) 3) call myFilterBar.UnwireGrid() 4) do what you are doing to change the columns 5) create a new GridFilterBar and wire it to your grid 6) call grid.CurrentCell.Moveto(2,1) 7) call grid.EndUpdate 6) call grid.Refresh() Doing it this way should make the filterbar not have any knowledge/dependencies on the old content of the grid.


UK Umesh Kumar July 1, 2004 04:01 PM UTC

Hi Clay, Thanks for replying all my queries. If I enable addnew property to true in GDBG,then the no of rows will be more than the actual rows(data rows). How to get the exact no of rows as in the table excluding the empty rows in the grid. If the addnew property is false,then number of rows are calculated as gridbound1.model.rowcount then how to calculate for the above case. Thanks & Regards, logicengineer. >I would try this. > >To change the columns in your grid, > >1) call grid.BeginUpdate() >2) call grid.CurrentCell.MoveTo(-1,-1) >3) call myFilterBar.UnwireGrid() >4) do what you are doing to change the columns >5) create a new GridFilterBar and wire it to your grid >6) call grid.CurrentCell.Moveto(2,1) >7) call grid.EndUpdate >6) call grid.Refresh() > >Doing it this way should make the filterbar not have any knowledge/dependencies on the old content of the grid.


AD Administrator Syncfusion Team July 1, 2004 04:19 PM UTC

The number of rows would be: grid.Model.RowCount - 1 - this.grid.Model.Rows.HeaderCount Or, you can get it directly from the datasource. BindingManagerBase bmb = this.BindingContext[this.gridDataBoundGrid1.DataSource, this.gridDataBoundGrid1.DataMember]; // bmb.Count holds the row count

Loader.
Live Chat Icon For mobile
Up arrow icon