Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to keep master and detail view column widths synchronized

$
0
0

When you have a master-detail view and for some reason don't want to use the AutoColumnWidth option, the detail view is still stretched to accommodate the entire master view's width. So, in this example we've decided to create a grid view that changes this behavior and synchronizes the detail view's width with the mater view's columns.
We create and register a GridView descendant that introduces the AutoSynchronizeDetailsLayout option by using a descendant of the GridOptionsView class. If this option is enabled and the AutoColumnWidth option is disabled the new behavior takes effect. The detail view's width is now calculated based on the master view columns' width, so, the detail view ends up with the last master view's column.
In addition, if the number of detail and master view columns is equal, the detail view's columns are aligned with that of the master view for even a smoother view.

Question Comments

Added By: andrei shannou at: 8/9/2013 5:46:31 AM    

Thanks,

It works, but a little buggy. Try to group a grid by any column, then change the width of any column. I seems to fall in infinite loop. Tried to find out why, but failed. Will appreciate your help if any.

Added By: andrei shannou at: 8/9/2013 6:39:35 AM    

Got it. Should be

                        rowVisibleIndex = GetNextVisibleRow(rowVisibleIndex);
                        rowHandle = GetRowHandle(rowVisibleIndex);

Added By: andrei shannou at: 8/9/2013 7:00:51 AM    

by the way, horizontal scrolling is also broken :-(

Added By: Mona Ghanathe 1 at: 6/22/2016 2:17:57 AM    In the example application, the master row does not expand. As a result I'm unable to determine if there is a scrollbar that comes up and if the columns are aligned.
In our application, we have one grid control consisting of 3 grid views under it. When the 3rd grid view (detail view) has been expanded, the vertical scrollbar takes up some space and as a result the detail view columns are not aligned with the master view. 
I'm unable to take reference from this ticket to resolve my issue because the master row does not expand when I run the example application attached with this ticket. Added By: Svetlana (DevExpress Support) at: 6/22/2016 3:20:11 AM    

Hello,

I've created a separate ticket on your behalf (T394960: A master row is not expanded). It has been placed in our processing queue and will be answered shortly.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>