简体   繁体   中英

Expander with GridSplitter

I've a grid splitter before to the expander(which exists in the right side of a wpf window) and when i was running the app i need to use grid splitter to see more data from expander after its expanded, but the problem is when i was drag splitter i'm getting full view of my expander irrespective of original width but after click on expander to collapse it won't go to its original position by maintaining the splitter dragged width. So any one help me how can i send back expander to its original position.

Thanks, @nagaraju.

Once you have used the splitter the grid column widths will no longer be 'auto'.
One solution is to respond to the collapsed event of the expander and reset the width of the first column to auto using column.Width=GridLength.Auto;

当您调整Expander的内容大小时, 将GridSplitter放置在Expander中可能更有意义,而在外部您只需要一个普通的Grid,这使得Expander的大小与内容的大小相同。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM