// do not throwvar tmp = grid.HeaderRowHeight;
grid.HeaderRowHeight = tmp;
if (grid.ConvertDpToPixels(tmp) != grid.HeaderRowHeight)
throw new Exception("Not expected");So I always get the height/width in px and have to put it in dp which is very confusing but may topped using Columns since the values will recalculated adding the column to grid.Syncfusion.SfDataGrid.GridTextColumn col = new Syncfusion.SfDataGrid.GridTextColumn(); Syncfusion.SfDataGrid.GridTextColumn col2 = new Syncfusion.SfDataGrid.GridTextColumn(); col.MinimumWidth = 100; double c1 = col.MinimumWidth; grid.Columns.Add(col); grid.Columns.Add(col2); col2.MinimumWidth = 100; double c2 = col2.MinimumWidth; if (c1 != c2) throw new Exception("Unexpected");so i need to check DataGrid property to know if i need convert to db or not. But this is not enough - if i doing:Syncfusion.SfDataGrid.GridTextColumn col3 = new Syncfusion.SfDataGrid.GridTextColumn(); col3.MinimumWidth = 100; // MinimumWidth = 100 grid.Columns.Add(col3); // MinimumWidth = 200 grid.Columns.Remove(col3); grid.Columns.Add(col3); // MinimumWidth = 400Since your GridModel have no virtual methods, it is not possible to change the behavior.
|
col2.MinimumWidth = 100;
double c2 = col2.MinimumWidth; //Value=203 //Converted Pixel value for internal calculation
double Orginalvalue = sfGrid.ConvertPixelsToDp(c2); //Value =100
//Use ConvertPixelsToDp to obtain original value
|