View previous topic :: View next topic |
Author |
Message |
Andrew Rowley
Joined: 24 Dec 2005 Posts: 63
|
Posted: Wed Feb 13, 2008 12:49 am Post subject: Saved settings & new columns |
|
|
If you add a new column to a tree where the user settings have been previously saved (column widths, visible columns etc) the new column appears at the far right.
This tends not to be an optimum place. While I understand it is difficult to fit it in when columns are rearranged/hidden etc. I think inserting it in approximately the right location would be better.
A better location would be to the right of the last visible column to it's left in the original layout (if that makes sense!)
eg. if you have 5 columns 1-5, rearranged and hidden so the user sees:
4, 1, 5, 3
and you add a new column between original columns 2 and 3 the best location is probably after column 1 ie.
4, 1, *, 5, 3
not:
4, 1, 5, 3, *
Or if you wanted to be a bit more complex, next to the closest visible column in the original layout, which would make the above example:
4, 1, 5, *, 3
(closest visible is column 3 to the right) |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Feb 13, 2008 9:42 pm Post subject: |
|
|
We'll take at a look at your suggestion - however I suspect it will not be easy to implement. _________________ Infralution Support |
|
Back to top |
|
|
Andrew Rowley
Joined: 24 Dec 2005 Posts: 63
|
Posted: Thu Feb 14, 2008 2:04 am Post subject: |
|
|
Hmm... I thought it shouldn't be too hard.
I'm not talking about adding rows after the tree is shown, but if for example you have a new software release with additional columns. The new columns would be there at the time the tree settings are restored.
I assumed it would be a case of tracking which columns didn't appear in the saved settings, then moving them to an appropriate place as the last step of restoring settings. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Feb 14, 2008 5:14 am Post subject: |
|
|
I'm not saying its impossible - just that the way the XML reading code works means that it won't be easy. You can of course handle this yourself if you have a specific case where you are adding a column and you want it to appear in a specific location. After you have called ReadXML call VirtualTree.Columns.SetIndexOf to set the index of the column in the collection to the required location. You would probably need to write a version flag in the XML so you could determine whether or not you need to do this or not. _________________ Infralution Support |
|
Back to top |
|
|
Andrew Rowley
Joined: 24 Dec 2005 Posts: 63
|
Posted: Fri Feb 15, 2008 1:34 am Post subject: |
|
|
My app has many different trees, each with many columns - writing and checking versioning for them all would be a big task.
However this actually affects anyone who saves and restores settings and wants to add a column - even if you are only saving column width or sort order. It is a particular problem if you DON'T allow the user to rearrange columns - because then the new column is in the wrong place and you can't move it.
You end up with a situation where the columns are correct for a new user, but in the wrong order for an upgrading user.
Even discarding the user's settings and reverting to the default if the column lists don't match would be better in most circumstances. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Feb 15, 2008 2:39 am Post subject: |
|
|
Quote: | However this actually affects anyone who saves and restores settings and wants to add a column - even if you are only saving column width or sort order. It is a particular problem if you DON'T allow the user to rearrange columns - because then the new column is in the wrong place and you can't move it. |
If your columns can't be moved by the end user then you can simply call Columns.SetIndexOf for each column after ReadXml (without worrying about versioning).
We will take a look at the issue - but it is not a trivial change. _________________ Infralution Support |
|
Back to top |
|
|
Andrew Rowley
Joined: 24 Dec 2005 Posts: 63
|
Posted: Fri Feb 15, 2008 3:03 am Post subject: |
|
|
OK. Most of my columns are movable, so it's not that simple for me. I guess one solution is to save/restore the column order externally.
My point with the non movable columns was that its not a trivial bug - it affects every virtual tree where the settings are saved, if they ever add (or rename?) a column. So everyone saving/restoring settings potentially needs to develop a workaround. I'm not expecting an instant fix - but the behavior is wrong, and should be fixed eventually.
The fundamental question is can you guarantee that the columns will appear in the order that they appear when you edit the tree? The answer is no, if you save/restore any settings - even when your columns are not defined as movable. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sun Feb 24, 2008 11:01 pm Post subject: |
|
|
We've had a look at this issue. The strategy that seems to make most sense is to preserve the index (location) of new columns. Thus if a new column is added at index 3 it will be inserted at index 3 after the saved columns order has been restored. Thus if a customer hasn't re-arranged the column order and you add a new column the restored column order will be the same as the default column order.
This scheme does not assume that the new column is somehow related to the one to the left of it and provides direct control over where the new column will appear. _________________ Infralution Support |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Feb 25, 2008 8:06 am Post subject: |
|
|
We've now released Version 3.9.0 which includes the fix described in the previous post. _________________ Infralution Support |
|
Back to top |
|
|
Andrew Rowley
Joined: 24 Dec 2005 Posts: 63
|
Posted: Tue Feb 26, 2008 2:47 am Post subject: |
|
|
Thanks, that is much appreciated. |
|
Back to top |
|
|
|