Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java and XpressQuantumTreeList(ActiveX)

Status
Not open for further replies.

carriemjohnson

Programmer
Aug 26, 2002
11
0
0
US
I am trying to sort a column within a tree list by numerical value rather than by text value, but am having trouble with it within Java.

Here's my problem: I'm trying to sort some of my columns within my tree list by integer value instead of by text value. My problem comes within the onCompare(Object source, dxtlist.dxTreeList.OnCompareEvent e) method. I can access e.Compare but can not assign a value to the compare object. What can I assign a value to in the compare method in order to complete the comparison? Here is the code I'm working with:

private void tlGBStudents_onCompare(Object source, dxtlist.dxTreeList.OnCompareEvent e)
{
int i=0;
dxtlist.IdxTreeColumns cols = tlGBStudents.getColumns();
while (i < cols.getCount())
{
//csNone = 2
if(cols.getItem(i).getSorted() != 2)
{
return;
}
i++;
}
if (i < cols.getCount())
{
//tedSpinEdit = 6
if (cols.getItem(i).getColumnType() == 6)
{
if((Integer.valueOf(e.Node1.getStrings(i)).intValue() - Integer.valueOf(e.Node2.getStrings(i)).intValue())>0)
e.Compare = 1;
else
e.Compare = -1;
}
else
{
if (e.Node1.getStrings(i) > e.Node2.getStrings(i))
e.Compare = 1;
else
e.Compare = -1;
}
}
else
{
e.Compare = 0;
}
}

But I keep getting an error saying cannot assign value to Compare final variable. Thanks in advance for your help.

Carrie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top