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

triggering event from outside of the control

Thread ID:

Created:

Updated:

Platform:

Replies:

57980 Mar 15,2007 08:56 AM UTC Mar 16,2007 02:44 PM UTC WinForms 1
loading
Tags: GridControl
Vicko Hazdovac
Asked On March 15, 2007 08:56 AM UTC

Hi
I'm trying to trigger the CurrentRecordContextChange event from outside of a GridGroupingControl. I'm tryng to do this so the event would be raised when I close the Parent form which holds my GridGruopingControl.

Essentially I whish to overrire the form's OnClose() method to raise GridGroupingControl's CurrentRecordContextChange event.

Is there a way I can do this?

Administrator [Syncfusion]
Replied On March 16, 2007 02:44 PM UTC

Hi Vicko,

If you wan to trigger the CurrentRecordContextChanged event of the grid then need to move the current record to some other position in a grid. Here is a code snippet to show this.

Record rec = this.gridGroupingControl1.Table.CurrentRecord;
if( rec != null)
{
int index = this.gridGroupingControl1.Table.Records.IndexOf(rec);
if( index > 0 )
this.gridGroupingControl1.Table.Records[index -1].SetCurrent();
else if (index == 0 )
this.gridGroupingControl1.Table.Records[1].SetCurrent();
}
else
this.gridGroupingControl1.Table.Records[0].SetCurrent();

Best regards,
Haneef

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

;