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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

CurrentRecordContextChange fires up two times

Thread ID:

Created:

Updated:

Platform:

Replies:

79656 Feb 19,2009 02:58 PM UTC Feb 28,2009 04:52 AM UTC WinForms 8
loading
Tags: Grouping
Reynante Bulayo
Asked On February 19, 2009 02:58 PM UTC

I have a code similar to the one below. My problem is that the event fires up twice. Because of this, the message box is shown two times. Please take a look below and let me know what the problem is. I want the event to be called just once. This is an urgent one. Thank you.

If e.Record IsNot Nothing Then
If e.Action = CurrentRecordAction.EndEditCalled _
Or e.Action = CurrentRecordAction.NavigateCalled Then
Dim rec As Record = gridGroupingControl1.Table.CurrentRecord
Dim colName As String
For i As Integer = 0 To ggc.TableDescriptor.Columns.Count - 1
colName = gridGroupingControl1.TableDescriptor.Columns(i).Name
If rec.GetValue(colName).ToString = "" Then
e.Cancel = True
MessageBox.Show("Please populate all required fields", "Error", _
MessageBoxButtons.OK,MessageBoxIcon.Exclamation)
Exit For
End If
Next
End If
End If


Jisha Joy [Syncfusion]
Replied On February 20, 2009 05:16 AM UTC

Hi Rentao ,

Thank you for the code snippets.

I have prepared a simple sample to reproduce the issue here. I am afraid that I was not able able to reproduce the issue here. Please refer the sample:

http://websamples.syncfusion.com/samples/Grid.Windows/Forum79656.zip


Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample or send us the reproducing steps so that we could sort out the cause of the issue
and provide you a solution?

Regards,
Jisha


Reynante Bulayo
Replied On February 23, 2009 12:39 PM UTC

Hi Jisha,

I have traced the flow of the code and below is the sequence:

1. I have modified the contents of the record and left some blank, then pressed enter.
1. Grid raises CurrentRecordContextChange event with e.action = EndEditComplete. The messagebox pops out.
2. Grid raises QueryCellStyleInfo event but the first event has only reached up to the code where the messagebox will be displayed.
3. Grid raises CurrentRecordContextChange one more time

Any ideas why I'm hitting this issue? Please help. This is an urgent inquiry. Thank you in advance. :)


Reynante Bulayo
Replied On February 24, 2009 02:44 PM UTC

Hi. I just want to follow up my inquiry. Thanks


Lingaraj S [Syncfusion]
Replied On February 24, 2009 05:18 PM UTC

Hi Rentao,

Thank for using a syncfusion product.

The CurrentRecordContextChange event will get fired for twice,this behaviour is because it has to handle both begin edit of the current cell and end edit on the other cell.
So it differs using a property called Action from the event args,you can handle by giving a condtion that depends on the Action property.

Let me know if you have any queries.

Regards,
Lingaraj S


Reynante Bulayo
Replied On February 27, 2009 03:28 AM UTC

Actually, the event is raised 2 times with the same action, EndEditCalled, for some reason. I still can't figure out why this is happening. From my understanding, after it enters the event with the said action, the next action should be EndEditComplete. However, this is not the case. Any ideas?


Jisha Joy [Syncfusion]
Replied On February 27, 2009 08:42 AM UTC

Hi Rentao,

Thank you for your update.


It is difficult to identify the problem without seeing it in a live application. Could you please reproduce the issue in the following sample or provide us a simple sample having the issue, so that we could sort out the cause of the issue and provide you a solution soon?

Regards,
Jisha



Reynante Bulayo
Replied On February 27, 2009 11:55 AM UTC

Hi Jisha,

Thanks for the reply. I'll try to recreate the issue and send you the code.


Jisha Joy [Syncfusion]
Replied On February 28, 2009 04:52 AM UTC

Hi Renteao,

Thank you for your update.

Regards,
Jisha


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

;