The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi - Is there a way to get the measure of the gridcontrol's column widths in absolute length units like points (pt) or inches (in) instead of pixels? Thanks, Julie
ADAdministrator Syncfusion Team January 25, 2007 05:02 PM UTC
Hi Julie,
By default, The colwidth is in pixels. If you want to get the colwidth in inch, you can use graphics.DpiX property to covert the colwidth in inch. Below is a code snippet to show this.
private double GetColWidthInches(GridControl grid, int ColIndex) { int pixelWidth = grid.GetColWidth(ColIndex); Graphics g = grid.CreateGridGraphics();//Disposed automatically. double InchWidth = pixelWidth/g.DpiX; return InchWidth; }
If you want to get the cell bounds in a grid, you can use the Renderer.GetCellBoundsCore method. Here is a code snippet.