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.

Event to capture that a new line is added to a GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

69941 Nov 19,2007 12:01 PM Nov 19,2007 12:36 PM Windows Forms 2
loading
Tags: Grouping
José Manuel
Asked On November 19, 2007 12:01 PM

Hello,

I'm looking for an event in a GridGroupingControl to inform me about a new row added because it has turned up in the datasource, other than the CurrencyManager's ListChanged event, which doesn't work for me, because record collections in the grid are not committed at that stage and I have incorrect results.

I want then to call SetCurrent on a cell of that row, to make the triangled black arrow appear on it.

Thank you very much for your help.

J.M.


Administrator [Syncfusion]
Replied On November 19, 2007 12:20 PM

Try the SourceListListChangedCompleted event and check for e.ListChangedType = ItemAdded.


//subscribe to the event
this.grid.SourceListListChangedCompleted += new TableListChangedEventHandler(grid_SourceListListChangedCompleted);

//the handler code
void grid_SourceListListChangedCompleted(object sender, TableListChangedEventArgs e)
{
if (e.ListChangedType == ListChangedType.ItemAdded)
{

}
}



Administrator [Syncfusion]
Replied On November 19, 2007 12:36 PM

To actually easily track the new record and set it current, you can use the SourceListRecordChanged event in addition to the SourceListListChangedCompleted event.


Record changedRecord = null;
void gridGroupingControl1_SourceListRecordChanged(object sender, Syncfusion.Grouping.RecordChangedEventArgs e)
{
changedRecord = e.Record;
}

void gridGroupingControl1_SourceListListChangedCompleted(object sender, Syncfusion.Grouping.TableListChangedEventArgs e)
{
if (e.ListChangedType == ListChangedType.ItemAdded && changedRecord != null)
changedRecord.SetCurrent();
}



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.

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.

;