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

Query on gridGroupingControl1.Validate() and gridGroupingControl1.Table.CurrentRecord.EndEdit()

Thread ID:

Created:

Updated:

Platform:

Replies:

30899 Jun 27,2005 05:27 AM UTC Jun 29,2005 11:18 AM UTC Windows Forms 9
loading
Tags: GridControl
Prathima Venkobachar
Asked On June 27, 2005 05:27 AM UTC

Hi, I am doing update to the database on click of the button and also when the user moves from one row to the other. The user can choose they want row by row update or batch update. To do row update I am doing on this.gridGroupingControl1.SourceListListChanged event. I have written a common function to call in both scenarios. To get the current slected column value I am using following three lines. this.gridGroupingControl1.Validate(); if (this.groupingGrid.SyncfusionGridControl.Table.CurrentRecord != null) this.groupingGrid.SyncfusionGridControl.Table.CurrentRecord.EndEdit(); vaildate() and EndEdit() fires, this.gridGroupingControl1.SourceListListChanged event. So when I do Update on click of a button, this in turn fires this.gridGroupingControl1.SourceListListChanged event. My common function is executing 3 times...How can I handle this..? Thanks, Prathima

Administrator [Syncfusion]
Replied On June 27, 2005 08:33 AM UTC

>>when I do Update on click of a button First thing to check is whether this button has its CausesValidation property set to true. If so, then the act of clicking the button will trigger a call to grid.Validate. Try setting button.CausesValdiation = false to see if that removes any of the calls to your saving code.

Prathima Venkobachar
Replied On June 27, 2005 11:37 AM UTC

Even if I do CauseValidation false, its not affecting. I feel problem is in these lines. this.gridGroupingControl1.Validate(); if (this.groupingGrid.SyncfusionGridControl.Table.CurrentRecord != null) this.groupingGrid.SyncfusionGridControl.Table.CurrentRecord.EndEdit(); I have written these lines in my common function. when I call this line this.gridGroupingControl1.Validate();, this in turn fires SourceListChanged event on my button click. Sourcelist changed event should be fired when I move from one row to other. But it is called when I am in the same row and try to update by clicking on the button. Can you suggest me, any other event where I can do the update when the user moves from one row to other..? Thanks, Prathima

Administrator [Syncfusion]
Replied On June 27, 2005 12:14 PM UTC

In a button click, you normally do not have to call Validate as it is called for you. Here is a little sample that saves the changes, as you move from row to row, or when you click a button, using a common save method. In this sample using 3.2.1.0, it only has to handle SourceListChanged to handle both cases. What are you doing differently? http://www.syncfusion.com/Support/user/uploads/GGC_HeaderText_d1f3057c.zip

Prathima Venkobachar
Replied On June 28, 2005 08:54 AM UTC

Hi, There is a slight difference in the way I am doing. I have made the grid as a user control, and placed the usercontrol in the form. I need a suggestion. where should I place these two lines. ((System.ComponentModel.ISupportInitialize)(this.gridGroupingControl1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gridGroupingControl1)).EndInit(); I have placed in the form, this is not getting me the current cell changes. Thanks, prathima

Administrator [Syncfusion]
Replied On June 28, 2005 09:09 AM UTC

I am not sure I understand your question. Normally, System.ComponentModel.ISupportInitialize.BeginInit/EndInit is part of the designer generated code. You do not have to call it at all. In your case, since the GridGroupingControl is on a UserControl, then this code would be found in the designer generated code in the user control class. And, unless you explicitly exposed the grid to the form, then you would not access the grid at all from within the form''s code. You would only interact with it in the UserControl class.

Prathima Venkobachar
Replied On June 28, 2005 09:18 AM UTC

Hi, Thnaks for the reply.You are right,It is there in my user control. On click of the button I am not getting the current cell changes. Thanks, Prathima

Prathima Venkobachar
Replied On June 28, 2005 09:21 AM UTC

>Hi, > >Thnaks for the reply.You are right,It is there in my user control. >On click of the button I am not getting the current row/cell changes. > >Thanks, >Prathima

Administrator [Syncfusion]
Replied On June 28, 2005 10:17 AM UTC

Here is that sample modified to use a usercontrol holding the grid. Clickong a button on the form causing the saing code to be hit once without doing anything special. Now, is your usercontrol directly on the form, or is it in a toolbar or some other container that might be affecting whether the usercontrol causes validation when you leave it? UC_GGC_4410.zip

Prathima Venkobachar
Replied On June 29, 2005 11:18 AM UTC

Hi, Thanks for the analysis. I am using my grid control in the form and opening the form from the menu. Control ,form and menu form are all in the different projects. I tried to solve tis problem by keping a flag check. I am able to update row by row and also on button click. Your suggestion help a lot !!. Thanks, Prathima

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

;