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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Click a row programmatically in a GridGroupingControl

Thread ID:





69821 Nov 13,2007 05:09 PM UTC Nov 23,2007 02:44 PM UTC WinForms 3
Tags: Grouping
José Manuel
Asked On November 13, 2007 05:09 PM UTC


I use the black triangled arrow (see attachment) in the row header column to mark the current row in a GridGroupingGrid.

The arrow appears when I mouse click any cell in a record or alternateRecord row.

Now I want to make it appear programmatically by code. If I use the CurrencyManager and set its Position property, the arrow doesn't appear.

So I need some code that is identical in behaviour to a mouse click of a cell.

And I need to do it inside CurrencyManager.ListChanged eventHandler, so I must find the cell using no more info than the index of the item in the CurrencyManager, i.e., accessing a cell collection in the grid with the same indexing scheme.

Any help?

Thank you very much.


haneefm [Syncfusion]
Replied On November 13, 2007 10:53 PM UTC

Hi Jose,

You need to call the Record.SetCurrent method to change the CurrencyManager position in a GridGroupingControl.Below is a code :

///set the CurrencyManager's position to first record.

Best regards,

José Manuel
Replied On November 15, 2007 09:47 PM UTC

Hi, Haneef,

I have a problem with your code, because of the event I am capturing.

I use the ListChanged event of the CurrencyManager. This event informs me of a new row in the CurrencyManager, and gives me the e.NewIndex the row will be at.

But, inside this event, the Records collection is not already committed, and in fact, something really strange happens, that I tell next:

If I inspect the Records collection while on the event handler, just before calling SetCurrent, the element in Records at the index e.NewIndex is the new row, replacing the one that existed previously there, which mysteriously has disappeared, but the SetCurrent method, executed there, makes the old row at that index the current row, thus preventing my change.

So, the row at e.NewIndex is the new row for the debugger inside the event handler, but the old row for the SetCurrent method. It seems to be that the grid is in an intermediate state where rows are not committed and grid collections are not to be trusted.

Is there any event, better than the ListChanged event of the CurrencyManager, where I could capture that a new row is added to the grid, and for which your code works to make the black arrow appear in a row programmatically?

Thank you very much.
Jose Manuel

Fathima Shalini P [Syncfusion]
Replied On November 23, 2007 02:44 PM UTC

Hi Jose,

Please do find the simple sample in the following link.


I have used gridGroupingControl1_SourceListListChangedCompleted method. In this sample I have added new records in the datasource and set the it as current cell.

Please do find the code snippet I have used to set the current position.

void gridGroupingControl1_SourceListListChangedCompleted(object sender, Syncfusion.Grouping.TableListChangedEventArgs e)
if (e.ListChangedType == ListChangedType.ItemAdded)

Please try this and let me know if this helps.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon