简体   繁体   中英

How to freeze columns and rows in WPF Grid

I'd like to "freeze" the columns and rows in WPF.

I want to implement a table (state machine), where in the first row are states and in first column are commands. The rest of the cells are filled with events. To improve usability, I'd like to keep the first row and first column visible all the time, so even at the very bottom of the table the states and commands are visible.

The DataGrid offers this kind of functionality but DataGrid cells don't look flexible enough. I'd like to use Grid. The ScrollViewer is basically what I need, but i haven't figured out how to use it for multiple Grids at the same time.

Is there any way to freeze first row and first column (at the same time)?

I don't think that there is no way to freeze columns or rows of a Grid. But you can use 4 Grids. Syncronize the Column and Rowsize with SharedSizeGroup .

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