IRowFilter behaves differently since version 3.5

Technote (FAQ)


Question

Why is the output different when using IRowFilter since version 3.5 ?

Cause

Starting in version 3.5, after the rows are filtered, they are also sorted.

Answer

You can override this behavior by sorting the rows each time the tree model changes.

For instance in the DragDrop sample, available in IBM ILOG Gantt .NET distribution, add the following before setting the RowFilter on each scheduleChart to force the rows to be sorted by Name.

 

TreeModelView mView1 = scheduleChart1.GanttTable.TreeModelView;
mView1.TreeModelChanged += new TreeModelChangeEventHandler(mView_TreeModelChanged);
TreeModelView mView2 = scheduleChart2.GanttTable.TreeModelView;
mView2.TreeModelChanged += new TreeModelChangeEventHandler(mView_TreeModelChanged);

And the mView_TreeModelChanged method is the following:

bool sorting = false; // this is needed to avoid infinite loop as SortRows

// method will fire TreeModelChanged event.

void mView_TreeModelChanged(object sender, TreeModelChangeEventArgs e)

{

if (!sorting)

{

sorting = true;

((TreeModelView)sender).SortRows(null, "Name", true, -1);

}

else

sorting = false;

}


Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

IBM ILOG Gantt for .NET

Software version:

3.5, 4.0

Operating system(s):

Windows

Reference #:

1602033

Modified date:

2012-07-23

Translate my page

Machine Translation

Content navigation