I have an UltraTree bound to a datatable, which has multible columns, but I'm displaying only one.
I tried to set the sorting this way but it is not working
ultraTree.Nodes.ColumnSetResolved.Columns[
DataAccessDefs.GroupAccountSortID].SortType = SortType.Ascending;
while DataAccessDefs.GroupAccountSortID is not displayed on the tree.
how can I set the sorting on a bound ultraTree using a column different than the displayed one
also, I would like as soon as I make a change to a row of the datatable, I would like the change to show on the tree, how can I do that?
benbak said: I have an UltraTree bound to a datatable, which has multible columns, but I'm displaying only one. I tried to set the sorting this way but it is not working ultraTree.Nodes.ColumnSetResolved.Columns[ DataAccessDefs.GroupAccountSortID].SortType = SortType.Ascending; while DataAccessDefs.GroupAccountSortID is not displayed on the tree. how can I set the sorting on a bound ultraTree using a column different than the displayed one
DataAccessDefs.GroupAccountSortID].SortType =
I tested this out and it worked fine for me. I am attaching my test project here so you can see if it works for you.
benbak said:I would like as soon as I make a change to a row of the datatable, I would like the change to show on the tree, how can I do that?
You can call the RefreshSort method on the tree to update the sorting.
Hi Mike,
Thank you for your reply. I tried both solutions mentioned above, but they didn't work for me.
is that because I'm building a hierarchy in the tree. the way I'm doing it is through column relations of dataset.
Hi,
Okay, so what you're doing is completely different from my sample.
It sounds like there are any number of places that this could be going wrong.
Are the rows sorted by sort_id initially?
Have you tried making the sort_id column visible? If not, you should try that, and make sure that when you update the sort_id on the data source, that's it actually showing up in the tree. This could be a problem with the notifications from your data source to the tree.
If the values are showing up in the tree and RefreshSort is not re-sorting, then something is wrong. Can you duplicate this in a small sample project and post it here so we can check it out?
I have a hierarchy of accounts belonging to groups, so each group has a set of accounts. the requirment is to change the sort order of two accounts, bringing one up and the other down. the way I'm doing it is by changing the sort_id column on each of the rows (rows in datatable bound to the tree). but after I switch the rows' sort_id, the change doesn't show up immediately on the hierarchy, even after I call RefreshSort.
but when I do the same with the project that you sent me, everything works perfectly, and the only difference that I see is your project is not in a hierarchichal structure and mine is.
Please help
I'm not sure what you mean by "both solutions mentioned above".
Did you run the sample project I attached? Did it work for you?
The fact that the tree is in a hierarchy doesn't really matter. You can still sort.What exactly are you trying to sort? The SortStyle is on the column, so it will only apply to islands of data that are using the column set that contains that column.
But the visibility of the column should not matter. Are you saying that if you make the hidden column visible, that it works?