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. Image for the cookie policy date

fire row changed event

I try to fire a event whenever the GGC row changed. I tried following code, it fired the event when row changed, but it also fired event when I click in different cell in the same row. I only want fire event when row changes. Any help? private void gdBase_CurrentRecordContextChange(object sender, Syncfusion.Grouping.CurrentRecordContextChangeEventArgs e) { if (e.Action==CurrentRecordAction.EnterRecordComplete) { if (this.gdBase.Table.CurrentRecord!= null) { Record rec = this.gdBase.Table.CurrentRecord ; DataRowView drv = rec.GetData() as DataRowView; GridRowChanged(drv); // fire my event to send the current row data } } }

6 Replies

AD Administrator Syncfusion Team June 10, 2005 10:57 AM

I think CurrentRecordContextChange is teh proper event to use. It is hit quite often, but for me the only time e.Action is LeaveRecordComplete is when you actually move off the current record. Here is the code in 3.2.1.0 that I used to show this.

private void gridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
{
	if(e.Action == CurrentRecordAction.LeaveRecordComplete)
	{
		Console.WriteLine(e.Action);
	}
}
Here is a sample. I might be missing something, but for me, the only time something appears in the output window is when you leave the record. Do you see something different? http://www.syncfusion.com/Support/user/uploads/GGC_ExpressionField_e5c0ccaa.zip


LM Lan Mo June 10, 2005 01:19 PM

Your sample works well and that is what I want. I copied your code, it doesn''t work on my GGC. I guess there are some property settings may affect the event behavior. >I think CurrentRecordContextChange is teh proper event to use. It is hit quite often, but for me the only time e.Action is LeaveRecordComplete is when you actually move off the current record. > >Here is the code in 3.2.1.0 that I used to show this. >
>
>private void gridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
>{
>	if(e.Action == CurrentRecordAction.LeaveRecordComplete)
>	{
>		Console.WriteLine(e.Action);
>	}
>}
>
> >Here is a sample. I might be missing something, but for me, the only time something appears in the output window is when you leave the record. Do you see something different? > > >http://www.syncfusion.com/Support/user/uploads/GGC_ExpressionField_e5c0ccaa.zip > >


AD Administrator Syncfusion Team June 10, 2005 01:25 PM

What other events are you handling? You might comment these out to see if they are affecting this behavior. Do you see any exceptions being listed in your putput window?


LM Lan Mo June 10, 2005 01:57 PM

I commented all event related to GGC. It doesn''t work either. No exception occured. I attached the form files here. Thanks, >What other events are you handling? You might comment these out to see if they are affecting this behavior. > >Do you see any exceptions being listed in your putput window? frmGrid_5457.zip


AD Administrator Syncfusion Team June 10, 2005 07:10 PM

I did not spot anything in your code. You could place a stop in that event to try to see if you can see if the call stack shows anything in your code. (It may not as the event may be an indirect consequence of something in your code.) Anothe rplace you can try to put your event is in the TableControlCurrentCellMoving event.
private void grid_TableControlCurrentCellMoving(object sender, GridTableControlCurrentCellMovingEventArgs e)
{
	GridCurrentCell cc = e.TableControl.CurrentCell;
	if(cc.MoveFromRowIndex != cc.MoveToRowIndex)
	{
		//raise your event...
	}
}


LM Lan Mo June 13, 2005 12:35 PM

Your code in event TableControlCurrentCellMoving works for me. Thanks, >I did not spot anything in your code. > >You could place a stop in that event to try to see if you can see if the call stack shows anything in your code. (It may not as the event may be an indirect consequence of something in your code.) > >Anothe rplace you can try to put your event is in the TableControlCurrentCellMoving event. >
>private void grid_TableControlCurrentCellMoving(object sender, GridTableControlCurrentCellMovingEventArgs e)
>{
>	GridCurrentCell cc = e.TableControl.CurrentCell;
>	if(cc.MoveFromRowIndex != cc.MoveToRowIndex)
>	{
>		//raise your event...
>	}
>}
>

Loader.
Live Chat Icon For mobile
Up arrow icon