Set all datagrid row heights when a single row height is changed

Sep 2, 2009 at 5:12 AM

Im looking to get the functionality that all row heights are always uniform.


So when i adjust a row height, all row heights are adjusted. any ideas?

Sep 2, 2009 at 9:57 PM

Hi aranm,

There is a DataGrid.RowHeight property that sets the default height for all rows.  I'm not sure what way you plan to resize the row heights, but if you want to do it visually by dragging the row header border then you need to set the CanUserResizeRows to true.  This should enable row resizing by dragging row header border.

As far as resizing all row heights in a consistent manner, I'm not sure if there's a trivial way of doing this, but someone suggested the following.

For uniform row heights I suggest setting CanUserResizeRows to false and set DataGrid.RowHeight.  If user resizing is needed along with uniform row heights, then re-template DataGridRowHeader, have your own drag handlers which affect only DataGrid.RowHeight instead of the local height. ~ V.P.

Hope that helps,
Saied Khanahmadi