How to make column widths match in two TreeListViews?

David

We have two TreeListViews that we display one above the other (with some other UI bits in the middle). We desire to have the widths of the columns in these two tree views match. We do use footers in the columns, and the footer widths would need to be taken into account. Something like SharedSizeDefinition as used on Grid ColumnDefinition and RowDefinition would be ideal, if possible. How can we do this, please?

example (not intended to build; cut down from the real application code):

David

And, I should add that it's the first column that is at issue. In our case, the widths of the second and third columns are reasonably well constrained. However, if we have names of "One", "Two", and "Three" in the first list but "Some Long Name", "Another Long Name", "Another Exceptionally Long Name" in the second list, we end up with visually mis-aligned columns.

David

The solution in that thread, if I read it correctly, isn't exactly what we want to do. The example binds the width of two corresponding columns to a property in the viewmodel; however, the net effect is that whichever TreeListView (or, in the example, GridView) last sets a width will determine the width of both.

For instance, if our first list contains "Some Long Name", "Another Long Name", and "Another Exceptionally Long Name", but our second list contains names of, "One", "Two", and "Three", the widths of both columns will be the width of the content in the second list, which is too short for the first list.

Just growing the width (the first posted solution in that thread, taking whichever is higher) isn't quite the right functionality, either. We're really looking for exactly SharedSizeDefinition functionality.

Nick

Unfortunately when the two widths are depending on a single property there is no way to ensure you get he max from both values. You can try to overcome this by using two separate properties for that, and simply return the Max from both as a width to the Columns.

Regards,
Nik
Telerik

Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.