Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wpf grid with frozen Column [closed]

Tags:

c#

wpf

grid

I have a Grid that contains User Controls, i'm using this Grid as a Matrix and i populate it with those User Controls.

I want to have the first column (ColumnDefinition) be frozen (from scrolling) of this Grid and so as the first Row (RowDefinition).

I will be so greatfull if you guys have any idea about this issue

This is what i want as a result

enter image description here

like image 705
AouledIssa Avatar asked Jun 05 '14 21:06

AouledIssa


2 Answers

After long hours of searching on google about this issue i found the solution ! also the answer of @voddy was helpful.

So the trick is to have a separed grid for the fixed Row (Header), same thing for the fixed Column and the Grid cells, so in the end we will be dealing with 3 Grid's witch every one of it have a ScrollViewer.

then we have to put them into a DockPannel and sychronize scrolling event using ScrollChanged Event and Horizontal and vertical Offsets .

like image 130
AouledIssa Avatar answered Nov 17 '22 15:11

AouledIssa


may be you can use a dockpanel for that purpose and have many grids positioned inside a dockpanel as you desire. It's difficult to suggest further as your requirement is not very clear.

like image 38
voddy Avatar answered Nov 17 '22 14:11

voddy