Hi,
I am trying to set different row heights on a row depending on a value in the underlying data.
So far I have worked out I can do the following...
var rows = rgv.ChildrenOfType<GridViewRow>();
int counter = 0;
foreach (GridViewRow gridViewRow in rows)
{
gridViewRow.Height = 20.0 + counter;
counter += 10;
}
This will set each row height to be 10 greater than its predecessor. The issue with this method is that the datagrid seems to calculate the height of the "rowspanel" based on the standard rowheight property and does not draw a vertical scroll bar, and also draws the horizontal scroll bar off the bottom of the visible area where it is not accessible.
My questions are is there a better way to achieve what I want? Maybe apply a style to the row whose height is bound to a property in the underlying data? Or is there some method I can call to "refresh" the datagrid to make it draw the horizontal scroll bar in the correct place and detect it needs to draw a vertical scroll bar.
Thanks
Andy
I am trying to set different row heights on a row depending on a value in the underlying data.
So far I have worked out I can do the following...
var rows = rgv.ChildrenOfType<GridViewRow>();
int counter = 0;
foreach (GridViewRow gridViewRow in rows)
{
gridViewRow.Height = 20.0 + counter;
counter += 10;
}
This will set each row height to be 10 greater than its predecessor. The issue with this method is that the datagrid seems to calculate the height of the "rowspanel" based on the standard rowheight property and does not draw a vertical scroll bar, and also draws the horizontal scroll bar off the bottom of the visible area where it is not accessible.
My questions are is there a better way to achieve what I want? Maybe apply a style to the row whose height is bound to a property in the underlying data? Or is there some method I can call to "refresh" the datagrid to make it draw the horizontal scroll bar in the correct place and detect it needs to draw a vertical scroll bar.
Thanks
Andy