i am using syncfusion 3.201.1.0 and need an advice how to use rowHeights.ResizeToFit on the GridDataBoundGrid. i can't move to 4.4 because there are still issues that affects me very badly.
i tried to use RowHeights.ResizeToFit() after populating the data to the table. if the user chances the sorting, i had to fire it again...
also if the data gets updated...
so i tried to use it on prepareviewstlyinfo and it seems to work very well, if i use GridRangeInfo.Row(e.RowIndex). but if you change the sorting, sometimes the grid didn't paint some rows. if you click on the cell, it will be painted... i have attached 2 screenshots.
on the first you can see, the refresh problem on the 2nd you can see what happen if you click on the invisible cell.
i really can't move to syncfusion 4.4. i eighter need a workaround or a better way to use RowHeights.ResizeToFit.
that's how my prepareviewstyleinfo looks like:
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
{
gridDataBoundGrid1.Model.RowHeights.ResizeToFit(Syncfusion.Windows.Forms.Grid.GridRangeInfo.Row(e.RowIndex),GridResizeToFitOptions.None);
if(e.RowIndex > 0)
{
try
{
int schweregrad = (int)dv[e.RowIndex - 1]["Schweregrad"];
if (schweregrad > 7)
e.Style.BackColor = Color.Red;
else if (schweregrad > 3)
e.Style.BackColor = Color.Yellow;
else
e.Style.BackColor = Color.Green;
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.ToString());
}
}
}
events1.zip