How does WPF DataGrid get frozen rows/columns working?

前端 未结 2 696
再見小時候
再見小時候 2020-12-11 17:16

I created a user control based on Grid (not DataGrid), which is wrapped in a ScrollViewer. Now I would like to have frozen rows/columns capability just like in DataGrid, but

2条回答
  •  眼角桃花
    2020-12-11 18:12

    Datagrid Column and Row has a property called "Frozen"

    if you want to freeze a column i recommend you do the following

    either you want it on selected Row or Column Event and then on the Event Get the Column/Row and mark it as Frozen = true

    or create another button or a context menu on mouse right click on which you Freeze/Unfreeze the currently marked

    column/row

    hope this helps

提交回复
热议问题