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.
Syncfusion Feedback

Formulas and deserialization issue

Thread ID:

Created:

Updated:

Platform:

Replies:

41536 Mar 3,2006 07:26 PM UTC Mar 16,2006 08:03 PM UTC Windows Forms 5
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 3, 2006 07:26 PM UTC

If you run the attached project, you will notice the following: 1) If you press the button, the value in B5 changes but the value in B2 (which has a formula that references B5) does not refresh until you select a range that includes B2. After you do that, B2''s contents always update when B5''s values changes. 2) If before you press the button, you select a range that includes B2, then when b5 changes, the change is immediately seen in b2 and it stays that way from then on. This only seems to happen if you deserialize a grid model. If you skip the deserialization, then B2 always refreshes when B5 changes. So, my question is: After deserialization, how can I get the grid model into the same state as the one induced by selecting a range that includes B2? Thanks

issue5.zip

Administrator [Syncfusion]
Replied On March 6, 2006 06:35 AM UTC

Hi Alex, Try gridModel.Refresh() after changing the values to see if that helps. Below is the code snippet. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ''Me.GridControl1.Model.Rows.InsertRange(3, 2) Dim gm As GridModel = Me.GridControl1.Model .......... ............ gm(5, 2).CellValue = 123 gm.Refresh() End Sub Regards, Calvin.

Administrator [Syncfusion]
Replied On March 6, 2006 05:25 PM UTC

Hi Calvin, Doing a gridmodel.Refresh() does work but since it (i''m assuming) forces a full refresh, it is slow. On a 60row, 20col grid, I can hit the button to change the value and refresh faster than the grid can refresh. If I call gridcontrol.RefreshRange with that one cell range, then it is instantaneous. My issue only occurs if you deserialize a grid model. If you try this with no deserialization, then it works perfectly. I just want to get the deserialized grid model in the same state as one created from scratch. I also don''t want to deal with special cases regarding wether the gridmodel is deserialized or not. Let me know your thoughts.

Administrator [Syncfusion]
Replied On March 10, 2006 12:11 PM UTC

Hi Alex, I apologize for the inconvenience caused. We are looking in to the issue and will get back with a solution soon. Regards, Calvin.

Administrator [Syncfusion]
Replied On March 15, 2006 10:09 AM UTC

Hi Alex, Sorry for the delayed reply. It is a focus issue when a grid with formula cells is de serialized. And the grid needs the focus during the dependent value for a formula cell changes. Just setting the focus to the grid in the button click handler will do. Below is a code snippet. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim gm As GridModel = Me.GridControl1.Model Me.GridControl1.Focus() gm(5, 2).CellValue = 123 End Sub Regards, Calvin.

Administrator [Syncfusion]
Replied On March 16, 2006 08:03 PM UTC

Hi Calvin, Thanks for the reply and the solution. It works, except that the gridcontrol.focus call has to be done in the button press event handler and I''m populating the grid in the load event of my form. Fortunately, while tackling another problem, I found that doing the following: gm = GridModel.LoadBinary("gridmodel.bin") Me.GridControl1.Model = gm gm.ActiveGridView = Me.GridControl1 solves the problem even if executed in the Load event handler. Is setting the active grid view something safe to do or will it cause other problems in your opinion?

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.

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

;