Perfect Stefan,
I did this, in the end and overloaded the method too to cover ListChangedType.Reset:
private void OnLinkViewChanged ( object sender, ListChangedEventArgs e )
{
// refresh the grid summaries
this.linkMonitorGrid.Table.SummariesDirty = true;
this.linkMonitorGrid.Refresh();
// if it''s an addition or an update
if ( e.ListChangedType == ListChangedType.ItemAdded || e.ListChangedType == ListChangedType.ItemChanged )
{
CheckForPossibleGridExpands( e.NewIndex );
}
else if ( e.ListChangedType == ListChangedType.Reset )
{
CheckForPossibleGridExpands();
}
}
private void CheckForPossibleGridExpands( int rowIndex )
{
int status = Convert.ToInt16( this.linkMonitorGridView.Table.Rows[rowIndex]["Status"] );
// compare the new status with the one currently stored in the grid
if ( status == 0 || status == 1 )
{
Record r = this.linkMonitorGrid.Table.UnsortedRecords[rowIndex];
// expand the grid group
r.ParentGroup.IsExpanded = true;
}
}
private void CheckForPossibleGridExpands()
{
for ( int i=0; i
JS
Jason Southgate
October 21, 2004 07:58 AM UTC
Sorry this was the overloaded method in the end:
private void CheckForPossibleGridExpands()
{
for ( int i=0; i