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

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

Thread ID:

Created:

Updated:

Platform:

Replies:

15489 Jun 20,2004 08:22 AM Jul 1,2004 12:19 PM Windows Forms 5
loading
Tags: GridControl
Umesh Kumar
Asked On June 20, 2004 08:22 AM

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.

Administrator [Syncfusion]
Replied On June 20, 2004 12:13 PM

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?

Umesh Kumar
Replied On June 20, 2004 01:07 PM

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?

Administrator [Syncfusion]
Replied On June 20, 2004 05:20 PM

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.

Umesh Kumar
Replied On July 1, 2004 12:01 PM

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.

Administrator [Syncfusion]
Replied On July 1, 2004 12:19 PM

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

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.

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.

;