Wpf – how to set all row heights of the wpf datagrid when one row height is adjusted

datagridrow-heightwpf

Im using the wpf datagrid and am looking for a way to set the height on all of the rows when the user adjusts one of them. I know the datagrid has a RowHeight property that sets all of the row heights at once, but the how of catching an individual row height changed escapes me

Best Answer

There aren't any events that could be use directly for that. What you could do is use another event that is fired when you resize the rows and other things. The event I'm thinking of right now is PreviewMouseUp, which is release when you release the mouse button anywhere if you datagrid.

What you could do is when the event is fired, you could check the row height of all of your rows and find the one that is different, then update all rows with it.

Related Topic