MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DataGridColumnSizer

    Show / Hide Table of Contents

    Class DataGridColumnSizer

    Represents a class that handles the sizing for all the GridColumns in the Columns collection in a SfDataGrid control.

    Inheritance
    System.Object
    DataGridColumnSizer
    Implements
    System.IDisposable
    Namespace: Syncfusion.Maui.DataGrid
    Assembly: Syncfusion.Maui.DataGrid.dll
    Syntax
    public class DataGridColumnSizer : Object, IDisposable

    Constructors

    DataGridColumnSizer()

    Initializes a new instance of the class.

    Declaration
    public DataGridColumnSizer()

    DataGridColumnSizer(SfDataGrid)

    Initializes a new instance of the class using the specified SfDataGrid instance,.

    Declaration
    public DataGridColumnSizer(SfDataGrid datagrid)
    Parameters
    Type Name Description
    SfDataGrid datagrid

    The reference of the SfDataGrid.

    Methods

    Dispose()

    Perform final clean up before it is released from memory.

    Declaration
    public void Dispose()

    OnComputeCellHeight(DataGridColumn, Object)

    Calculates the height of the data row's cells. You can override this method to perform the custom calculation for height.

    Declaration
    protected virtual double OnComputeCellHeight(DataGridColumn column, object cellValue)
    Parameters
    Type Name Description
    DataGridColumn column

    The Current Column

    System.Object cellValue

    The value of the current grid cell.

    Returns
    Type Description
    System.Double

    OnComputeCellWidth(DataGridColumn, String)

    Measures and returns the text width based on the cell value.

    Declaration
    protected virtual double OnComputeCellWidth(DataGridColumn column, string text)
    Parameters
    Type Name Description
    DataGridColumn column

    current column.

    System.String text

    current column text.

    Returns
    Type Description
    System.Double

    Returns the text width based on the cell value.

    OnComputeHeaderCellHeight(String, DataGridColumn)

    Calculates the height of the header cells. You can override this method to perform the custom calculation for height.

    Declaration
    protected virtual double OnComputeHeaderCellHeight(string cellValue, DataGridColumn column = null)
    Parameters
    Type Name Description
    System.String cellValue

    The value of the HeaderCell

    DataGridColumn column

    The current column.

    Returns
    Type Description
    System.Double

    OnComputeHeaderCellWidth(String, DataGridColumn)

    Calculates the width of the header cells. You can override this method to perform the custom calculation for width.

    Declaration
    protected virtual double OnComputeHeaderCellWidth(string cellValue, DataGridColumn column = null)
    Parameters
    Type Name Description
    System.String cellValue

    Value of the header cell.

    DataGridColumn column

    The current column.

    Returns
    Type Description
    System.Double

    Returns the width required to auto-fit the given column based on its header content.

    Refresh(Boolean)

    Refreshes the GridColumns in the view.

    Declaration
    public void Refresh(bool needsLayout = true)
    Parameters
    Type Name Description
    System.Boolean needsLayout

    A boolean value specifying whether layout is needed.

    Implements

    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved