menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridModel - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class GridModel

    This is the GridModel class that holds all data information about a grid and provides methods to completely initialize a grid and attach it later to a GridControlBase so that its contents can be rendered to the screen.

    Inheritance
    System.Object
    GridModel
    GridDataGroupDropAreaModel
    GridDataTableModel
    GridListModel
    GridTreeSerializableProperty
    OlapGridModel
    Implements
    IGridVolatileCellStylesHost
    IOperationFeedbackProvider
    System.IDisposable
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Windows.Controls.Grid
    Assembly: Syncfusion.Grid.Wpf.dll
    Syntax
    public class GridModel : IGridVolatileCellStylesHost, IOperationFeedbackProvider, IDisposable
    Remarks

    A GridModel holds all data for a grid. It offers many events that you can subscribe to and modify the default behavior of the grid. A GridModel holds a GridCellModelCollection that holds models for all cell types used in the grid. If a cell queries for a new cell type that is not found in the cell model collection, it tries to instantiate a GridCellModelBase object for the specific cell type. A QueryCellModel event is raised to allow you to create custom cell types on demand. But you can also instantiate cell models for custom cell types at initialization and add them to CellModels.

    There is also a GridControl class that combines both GridModel and GridControlBase into one class. This gives you easier access to all methods of GridModel.

    Constructors

    GridModel()

    Initializes a new GridModel.

    Declaration
    public GridModel()

    Properties

    ActiveGridView

    Gets or sets the active grid view.

    Declaration
    public GridControlBase ActiveGridView { get; set; }
    Property Value
    Type
    GridControlBase
    Remarks

    If there are several views associated with this model, only one GridControlBase can be active.

    Changing the active view will result in calls to Deactivate() and Activate(Int32, Int32) for the involved controls.

    BaseStylesMap

    The GridBaseStylesMap that is associated with this GridModel.

    Declaration
    public GridBaseStylesMap BaseStylesMap { get; set; }
    Property Value
    Type
    GridBaseStylesMap

    CachedHScrollValue

    Gets or sets cached horizontal scroll value.

    Declaration
    public double CachedHScrollValue { get; set; }
    Property Value
    Type
    System.Double

    CachedVScrollValue

    Gets or sets cached vertical scroll value.

    Declaration
    public double CachedVScrollValue { get; set; }
    Property Value
    Type
    System.Double

    CellModels

    Manages cell types for the grid.

    Declaration
    public GridCellModelCollection CellModels { get; }
    Property Value
    Type
    GridCellModelCollection

    CellSpanBackgrounds

    Gets cell spans in the grid.

    Declaration
    public GridCellSpanBackgroundInfoCollection CellSpanBackgrounds { get; }
    Property Value
    Type
    GridCellSpanBackgroundInfoCollection

    ColStyles

    Gives you access to the column style information of a column.

    Declaration
    public GridStyleInfoIndexer ColStyles { get; }
    Property Value
    Type
    GridStyleInfoIndexer
    Remarks

    The indexer provides you with a very simple way to query and change column style contents.

    Examples

    The following example make some changes to the grid using the indexer:

                model.ColStyles[2].Font.Bold = true;
                model.ColStyles[2].Font.FontSize = 16;
                model.ColStyles[2].HorizontalAlignment = HorizontalAlignment.Center;
                model.ColStyles[2].VerticalAlignment = VerticalAlignment.Center;
                model.ColStyles[2].CellType = "Static";

    If you query for specific attributes in a cell and these attributes have not been explicitly set, the GridStyleInfo object that is return by the indexer is smart enough to query base styles for queried information.

                model.ColStyles[1].Background = Brushes.Red;
                    Brush color = model[1, 1].Background;
                    // model[1, 1].TextColor will return Brushes.Red

    ColumnCount

    Gets or sets the number of columns in the grid.

    Declaration
    public int ColumnCount { get; set; }
    Property Value
    Type
    System.Int32

    ColumnWidths

    Gets column widths for the grid.

    Declaration
    public IPaddedEditableLineSizeHost ColumnWidths { get; set; }
    Property Value
    Type
    IPaddedEditableLineSizeHost

    CommandStack

    Gets undo and redo in the grid.

    Declaration
    public GridModelCommandManager CommandStack { get; }
    Property Value
    Type
    GridModelCommandManager

    CoveredCells

    Gets covered cells in the grid.

    Declaration
    public GridCoveredCellInfoCollection CoveredCells { get; }
    Property Value
    Type
    GridCoveredCellInfoCollection

    CoveredRanges

    Declaration
    public GridCoveredCellInfoCollection CoveredRanges { get; }
    Property Value
    Type
    GridCoveredCellInfoCollection

    CurrentCellState

    GridCurrentCell.Activate and GridCurrentCell.Deactivate set and reset this state.

    Declaration
    public GridModelCurrentCellState CurrentCellState { get; set; }
    Property Value
    Type
    GridModelCurrentCellState

    CutPaste

    Gets clipboard operations for the grid.

    Declaration
    public GridModelCutPaste CutPaste { get; }
    Property Value
    Type
    GridModelCutPaste

    Data

    Gets or sets a GridCellData object that saves cell contents and row and column headers for the GridModel.

    Declaration
    public GridCellData Data { get; }
    Property Value
    Type
    GridCellData

    DisableEditorsContextMenu

    Declaration
    public bool DisableEditorsContextMenu { get; set; }
    Property Value
    Type
    System.Boolean

    DragDropData

    Declaration
    public GridModel.InternalGridDragDropData DragDropData { get; }
    Property Value
    Type
    Syncfusion.Windows.Controls.Grid.GridModel.InternalGridDragDropData

    EnableContextMenu

    Declaration
    public bool EnableContextMenu { get; set; }
    Property Value
    Type
    System.Boolean

    EventsHost

    Gets IGridModelEventsHost that defines the events for the grid model.

    Declaration
    public IGridModelEventsHost EventsHost { get; set; }
    Property Value
    Type
    IGridModelEventsHost

    FooterColumns

    Gets or sets the number of footer columns.

    Declaration
    public int FooterColumns { get; set; }
    Property Value
    Type
    System.Int32

    FooterRows

    Gets or sets the number of footer rows.

    Declaration
    public int FooterRows { get; set; }
    Property Value
    Type
    System.Int32

    FooterStyle

    Gets the footer style.

    Declaration
    public GridStyleInfo FooterStyle { get; }
    Property Value
    Type
    GridStyleInfo

    FormulaEngine

    Declaration
    public GridFormulaEngine FormulaEngine { get; set; }
    Property Value
    Type
    GridFormulaEngine

    FrozenColumns

    Gets or sets the number of frozen columns.

    Declaration
    public int FrozenColumns { get; set; }
    Property Value
    Type
    System.Int32

    FrozenRows

    Gets or sets the number of frozen rows.

    Declaration
    public int FrozenRows { get; set; }
    Property Value
    Type
    System.Int32

    GraphicModel

    Declaration
    public GraphicModel GraphicModel { get; set; }
    Property Value
    Type
    GraphicModel

    GridCopyPaste

    Gets or sets the GridCutPaste

    Declaration
    public IGridCopyPaste GridCopyPaste { get; set; }
    Property Value
    Type
    IGridCopyPaste

    HasBaseStylesMap

    Determines whether BaseStylesMap has been associated with this GridModel.

    Declaration
    public bool HasBaseStylesMap { get; }
    Property Value
    Type
    System.Boolean

    HeaderColumns

    Gets or sets the number of header columns.

    Declaration
    public int HeaderColumns { get; set; }
    Property Value
    Type
    System.Int32

    HeaderRows

    Gets or sets the number of header rows.

    Declaration
    public int HeaderRows { get; set; }
    Property Value
    Type
    System.Int32

    HeaderStyle

    Gets the header style.

    Declaration
    public GridStyleInfo HeaderStyle { get; }
    Property Value
    Type
    GridStyleInfo

    HiddenColRanges

    Read only collection of hidden columns.

    Declaration
    public ReadOnlyObservableCollection<GridRangeInfo> HiddenColRanges { get; protected set; }
    Property Value
    Type
    System.Collections.ObjectModel.ReadOnlyObservableCollection<GridRangeInfo>

    HiddenRowRanges

    Read only collection of hidden rows.

    Declaration
    public ReadOnlyObservableCollection<GridRangeInfo> HiddenRowRanges { get; protected set; }
    Property Value
    Type
    System.Collections.ObjectModel.ReadOnlyObservableCollection<GridRangeInfo>

    IgnoreReadOnly

    Gets or sets a value indicating whether to make changes to Read-only cells. Set this True if you want to be able make changes to Read-only cells.

    Declaration
    public bool IgnoreReadOnly { get; set; }
    Property Value
    Type
    System.Boolean

    Item[Int32, Int32]

    Gives you access to the style information of a cell.

    Declaration
    public GridStyleInfo this[int rowIndex, int columnIndex] { get; set; }
    Parameters
    Type Name Description
    System.Int32 rowIndex

    Row index.

    System.Int32 columnIndex

    Column index.

    Property Value
    Type Description
    GridStyleInfo

    Cell style.

    Remarks

    The indexer provides you with a very simple way to query and change cell contents.

    Options

    A GridModelOptions that allows you to adjust behavior and appearance of the grid.

    Declaration
    public GridModelOptions Options { get; set; }
    Property Value
    Type
    GridModelOptions

    OverlappingCells

    Declaration
    public GridOverlappingCellInfoCollection OverlappingCells { get; }
    Property Value
    Type
    GridOverlappingCellInfoCollection

    RowCount

    Gets or sets the number of rows in the grid.

    Declaration
    public int RowCount { get; set; }
    Property Value
    Type
    System.Int32

    RowHeights

    Gets row heights for the grid.

    Declaration
    public IPaddedEditableLineSizeHost RowHeights { get; }
    Property Value
    Type
    IPaddedEditableLineSizeHost

    RowStyles

    Gives you access to the row style information of a row.

    Declaration
    public GridStyleInfoIndexer RowStyles { get; }
    Property Value
    Type Description
    GridStyleInfoIndexer

    The row styles.

    Remarks

    The indexer provides you with a very simple way to query and change row style contents.

    Examples

    The following example make some changes to the grid using the indexer:

    model.RowStyles[2].Font.Bold = true;
    model.RowStyles[2].Font.FontSize = 16;
    model.RowStyles[2].HorizontalAlignment = HorizontalAlignment.Center;
    model.RowStyles[2].VerticalAlignment = VerticalAlignment.Center;
    model.RowStyles[2].CellType = "Static";

    If you query for specific attributes in a cell and these attributes have not been explicitly set for the cell, the GridStyleInfo object that is returned by the indexer is smart enough to query base styles for queried information.

    model.RowStyles[1].Background = Brushes.Red;
    Brush color = model[1, 1].Background;
    // model[1, 1].TextColor will return Brushes.Red

    SelectedCells

    Gets or sets selected cells in the grid.

    Declaration
    public GridRangeInfo SelectedCells { get; set; }
    Property Value
    Type
    GridRangeInfo

    SelectedRanges

    Gets Selected Ranges.

    Declaration
    public virtual GridRangeInfoList SelectedRanges { get; }
    Property Value
    Type
    GridRangeInfoList

    Selections

    Manages selected ranges in the grid. Allows you to add and remove selections, determines selection state of a specific cell and more.

    Declaration
    public GridModelSelections Selections { get; }
    Property Value
    Type
    GridModelSelections

    ShouldRecordUndo

    Gets a value indicating whether undo information should be logged.

    Declaration
    public virtual bool ShouldRecordUndo { get; }
    Property Value
    Type
    System.Boolean

    Sizer

    Declaration
    public GridColumnAutoSizer Sizer { get; }
    Property Value
    Type
    GridColumnAutoSizer

    SupportsQueryCoveredCellCallback

    Declaration
    public bool SupportsQueryCoveredCellCallback { get; set; }
    Property Value
    Type
    System.Boolean

    TableStyle

    Gets the table style. Individual cells will inherit attributes from the table style.

    Declaration
    public GridStyleInfo TableStyle { get; set; }
    Property Value
    Type
    GridStyleInfo

    TextDataExchange

    Declaration
    public virtual GridModelTextDataExchange TextDataExchange { get; set; }
    Property Value
    Type
    GridModelTextDataExchange

    UserData

    Gets / sets the user-definable data for the current object.

    Declaration
    public IDictionary UserData { get; }
    Property Value
    Type
    System.Collections.IDictionary

    Views

    Gets the grid views for the current grid model.

    Declaration
    public IEnumerable<GridControlBase> Views { get; }
    Property Value
    Type
    System.Collections.Generic.IEnumerable<GridControlBase>

    VolatileCellStyles

    Gets GridVolatileCellStyles that defines an interface that IGridVolatileCellStylesHost utilizes to query cell contents and base styles, look up cell types, and save changes back to the grid.

    Declaration
    public GridVolatileCellStyles VolatileCellStyles { get; }
    Property Value
    Type
    GridVolatileCellStyles

    VolatileCellStylesFactoryMethod

    This Factory Method setter lets you replace the default GridVolatileData store with your own custom volatile data store derived from IGridVolatileData.

    Declaration
    public Func<GridModel, GridVolatileCellStyles> VolatileCellStylesFactoryMethod { get; set; }
    Property Value
    Type
    System.Func<GridModel, GridVolatileCellStyles>
    Remarks
    This example shows how to attach a CustomVolatileData object derived from IGridVolatileData.
    public Window1()
    {
        InitializeComponent();
    
    // Replace default GridVolatileData with CustomVolatileData
    grid.Model.VolatileCellStylesFactoryMethod = delegate(GridModel model)
    {
        return new GridVolatileCellStyles(model, new CustomVolatileData());
    };
    
    // a really large row and column count.
    grid.Model.RowCount = 9900;
    grid.Model.ColumnCount = 100; // 1 million
    
    // fill cell contents on demand.
    grid.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(Model_QueryCellInfo);
    

    }

    Public Sub New()
        InitializeComponent()
    
        ' Replace default GridVolatileData with CustomVolatileData
        grid.Model.VolatileCellStylesFactoryMethod = 
            Function(model As GridModel) New GridVolatileCellStyles(model, New CustomVolatileData())
    
        ' a really large row and column count.
        grid.Model.RowCount = 9900
        grid.Model.ColumnCount = 100
        ' 1 million
        ' Resize millions of rows instantly - pixel scrolling is updated accordingly.
        grid.Model.TableStyle.CellType = "TextBox"
        ' see checkBoxRows_Checked below for instantly hiding most of the 99 million rows
    
        AddHandler grid.Model.QueryCellInfo, AddressOf Model_QueryCellInfo
    End Sub

    Methods

    ChangeCells(GridRangeInfo, GridStyleInfo)

    Applies a style to the specified range of cells.

    Declaration
    public bool ChangeCells(GridRangeInfo range, GridStyleInfo cellInfo)
    Parameters
    Type Name Description
    GridRangeInfo range

    A GridRangeInfo that specifies the range of cells.

    GridStyleInfo cellInfo

    The GridStyleInfo object that holds cell information.

    Returns
    Type Description
    System.Boolean

    A System.Boolean that indicates if the operation was successful.

    ChangeCells(GridRangeInfo, GridStyleInfo, StyleModifyType)

    Applies a style to the specified range of cells.

    Declaration
    public bool ChangeCells(GridRangeInfo range, GridStyleInfo cellInfo, StyleModifyType modifyType)
    Parameters
    Type Name Description
    GridRangeInfo range

    A GridRangeInfo that specifies the range of cells.

    GridStyleInfo cellInfo

    The GridStyleInfo object that holds cell information.

    StyleModifyType modifyType

    A StyleModifyType that specifies the style operation to be performed.

    Returns
    Type Description
    System.Boolean

    A System.Boolean that indicates if the operation was successful.

    ChangeCells(GridRangeInfo, GridStyleInfo[])

    Applies an array of styles to the specified range of cells.

    Declaration
    public bool ChangeCells(GridRangeInfo range, GridStyleInfo[] cellsInfo)
    Parameters
    Type Name Description
    GridRangeInfo range

    A GridRangeInfo that specifies the range of cells.

    GridStyleInfo[] cellsInfo

    The array of GridStyleInfo objects that holds cell information.

    Returns
    Type Description
    System.Boolean

    A System.Boolean that indicates if the operation was successful.

    ChangeCells(GridRangeInfo, GridStyleInfo[], StyleModifyType)

    Applies an array of styles to the specified range of cells.

    Declaration
    public virtual bool ChangeCells(GridRangeInfo range, GridStyleInfo[] cellsInfo, StyleModifyType modifyType)
    Parameters
    Type Name Description
    GridRangeInfo range

    A GridRangeInfo that specifies the range of cells.

    GridStyleInfo[] cellsInfo

    The array of GridStyleInfo objects that holds cell information.

    StyleModifyType modifyType

    A StyleModifyType that specifies the style operation to be performed.

    Returns
    Type Description
    System.Boolean

    A System.Boolean that indicates if the operation was successful.

    Remarks

    ChangeCells(GridRangeInfo, GridStyleInfo[], StyleModifyType) will reset volatile data cache, generate undo information, force recalculation of floating cells, and raise and method.

    When you change cells directly with an indexer, this results in a call to ChangeCells(GridRangeInfo, GridStyleInfo[], StyleModifyType) with modifyType set to Changes.

    Examples

    The following example assigns a previously create style with a bold font to a cell:

                GridStyleInfo boldFontStyle = new GridStyleInfo();
                boldFontStyle.Foreground = new SolidColorBrush(Colors.Red);
                boldFontStyle.Font.FontWeight = FontWeights.Bold;
                model[2, 1].Text = "Interior";
                model.ChangeCells(GridRangeInfo.Cell(2, 1), boldFontStyle);

    ChangeCells(GridRangeInfo, String)

    Applies a text to the specified range of cells.

    Declaration
    public bool ChangeCells(GridRangeInfo range, string textValue)
    Parameters
    Type Name Description
    GridRangeInfo range

    A GridRangeInfo that specifies the range of cells.

    System.String textValue

    The text to be saved in cells.

    Returns
    Type Description
    System.Boolean

    A System.Boolean that indicates if the operation was successful.

    ChangeSelectionState(Int32, Int32, GridRangeInfo[])

    Records current selection state - current cell and selected ranges. Will be used for restoring selections when performing undo / redo,

    Declaration
    public void ChangeSelectionState(int currentRow, int currentCol, GridRangeInfo[] ranges)
    Parameters
    Type Name Description
    System.Int32 currentRow

    The row index of current cell.

    System.Int32 currentCol

    The column index of current cell.

    GridRangeInfo[] ranges

    The current list of selected ranges.

    CreateAutoSizer()

    Declaration
    protected virtual GridColumnAutoSizer CreateAutoSizer()
    Returns
    Type
    GridColumnAutoSizer

    CreateGridMoveCellsState(IEditableLineSizeHost)

    Declaration
    protected virtual GridMoveCellsState CreateGridMoveCellsState(IEditableLineSizeHost lineSizes)
    Parameters
    Type Name Description
    IEditableLineSizeHost lineSizes
    Returns
    Type
    GridMoveCellsState

    CreateVolatileCellStyles()

    Creates the GridVolatileCellStyles objects which allocates style objects and maintains a weak reference to them.

    Override this method to provide your own custom custom volatile data store or assign a delegate as shown in VolatileCellStylesFactoryMethod method. The default version for CreateVolatileCellStyles checks VolatileCellStylesFactoryMethod property and calls the delegate.

    Declaration
    protected virtual GridVolatileCellStyles CreateVolatileCellStyles()
    Returns
    Type
    GridVolatileCellStyles

    Deserialize(String)

    Deserializes the specified GridModel.

    Declaration
    public virtual void Deserialize(string fileName)
    Parameters
    Type Name Description
    System.String fileName

    DeserializeFromStream(TextReader)

    Deserializes from stream.

    Declaration
    public virtual void DeserializeFromStream(TextReader textReader)
    Parameters
    Type Name Description
    System.IO.TextReader textReader

    The text reader.

    DeserializeFromString(String)

    Deserializes GridModel properties from string.

    Declaration
    public virtual void DeserializeFromString(string content)
    Parameters
    Type Name Description
    System.String content

    The content.

    Dispose()

    Disposes all the resources used by the GridModel class.

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Disposes all the resources used by the GridModel class.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    true to release all the resources.

    GetCachedStandardValues(TypeConverter, Type)

    Returns a list with standard values / possible choices for the specified TyepConverter and Type. Helper routined for GetStyleDataSource(GridStyleInfo).

    Declaration
    public GridPropertyStandardValuesList GetCachedStandardValues(TypeConverter converter, Type propertyType)
    Parameters
    Type Name Description
    System.ComponentModel.TypeConverter converter

    The TypeConverter

    System.Type propertyType

    The Type

    Returns
    Type Description
    GridPropertyStandardValuesList

    Possible choices for the specified TyepConverter and Type

    GetCellInfo(Int32, Int32, GridStyleInfo)

    Gets style data (the GridStyleInfoStore) from GridData.

    Declaration
    public bool GetCellInfo(int rowIndex, int colIndex, GridStyleInfo style)
    Parameters
    Type Name Description
    System.Int32 rowIndex

    Row index.

    System.Int32 colIndex

    Column index.

    GridStyleInfo style

    The style object that will receive data.

    Returns
    Type Description
    System.Boolean

    A System.Boolean that indicates, if the specified cell information modified with the updated style

    Remarks

    If QueryCellInfo did not set the e.Handled to true, the method gets the style data (the GridStyleInfoStore) from GridData and applies its data to the style object. Existing data of the style parameter previously initialized with QueryCellInfo will be preserved.

    GetCellsInfo(GridRangeInfo)

    Declaration
    public virtual GridStyleInfo[] GetCellsInfo(GridRangeInfo range)
    Parameters
    Type Name Description
    GridRangeInfo range
    Returns
    Type
    GridStyleInfo[]

    GetStyleDataSource(GridStyleInfo)

    This is called from GridDropDownGridListControlCellModel to initialize datasource on demand. Override this method to calculate the datasource on demand only when it is needed and not every time in QueryStyleInfo. Default behavior is to return style.ChoiceList if not empty. If style.ChoiceList is empty, style.ItemsSource is returned.

    Declaration
    public virtual IEnumerable GetStyleDataSource(GridStyleInfo style)
    Parameters
    Type Name Description
    GridStyleInfo style

    The GridStyleInfo object.

    Returns
    Type Description
    System.Collections.IEnumerable

    The style datasource.

    InsertColumns(Int32, Int32)

    Inserts the given number of columns at the specified column index.

    Declaration
    public virtual void InsertColumns(int insertAtColumnIndex, int count)
    Parameters
    Type Name Description
    System.Int32 insertAtColumnIndex

    The column index to insert.

    System.Int32 count

    Number of columns to be inserted.

    InsertColumnsCore(Int32, Int32, GridMoveCellsState)

    Declaration
    protected virtual void InsertColumnsCore(int insertAtColumnIndex, int count, GridMoveCellsState moveCellsState)
    Parameters
    Type Name Description
    System.Int32 insertAtColumnIndex
    System.Int32 count
    GridMoveCellsState moveCellsState

    InsertRows(Int32, Int32)

    Inserts specified number of rows at the given row index.

    Declaration
    public virtual void InsertRows(int insertAtRowIndex, int count)
    Parameters
    Type Name Description
    System.Int32 insertAtRowIndex

    The row index to insert.

    System.Int32 count

    Number of rows to be inserted

    InsertRowsCore(Int32, Int32, GridMoveCellsState)

    Declaration
    protected virtual void InsertRowsCore(int insertAtRowIndex, int count, GridMoveCellsState moveCellsState)
    Parameters
    Type Name Description
    System.Int32 insertAtRowIndex
    System.Int32 count
    GridMoveCellsState moveCellsState

    InvalidateCell(CellSpanInfoBase)

    Calls GridControlBase.InvalidateCell for each GridControlBase object associated with this GridModel.

    Declaration
    public void InvalidateCell(CellSpanInfoBase span)
    Parameters
    Type Name Description
    CellSpanInfoBase span

    The spanned ranges to be repainted.

    InvalidateCell(RowColumnIndex)

    Calls GridControlBase.InvalidateCell for each GridControlBase object associated with this GridModel.

    Declaration
    public void InvalidateCell(RowColumnIndex cellRowColumnIndex)
    Parameters
    Type Name Description
    RowColumnIndex cellRowColumnIndex

    The cell row column index.

    InvalidateCell(GridRangeInfo)

    Calls GridControlBase.InvalidateCell for each GridControlBase object associated with this GridModel.

    Declaration
    public void InvalidateCell(GridRangeInfo gridRangeInfo)
    Parameters
    Type Name Description
    GridRangeInfo gridRangeInfo

    The range of cells to be repainted.

    InvalidateVisual()

    Invalidates the complete visual.

    Declaration
    public void InvalidateVisual()

    InvalidateVisual(Boolean)

    Invalidates the complete visual.

    Declaration
    public void InvalidateVisual(bool setArrangeDirty)
    Parameters
    Type Name Description
    System.Boolean setArrangeDirty

    When set to true, forces a complete new layout.

    IsCols(GridRangeInfoList)

    Returns true if all the GridRangeInfo in this list is of Type Col, otherwise returns false.

    Declaration
    public bool IsCols(GridRangeInfoList rangeList)
    Parameters
    Type Name Description
    GridRangeInfoList rangeList
    Returns
    Type
    System.Boolean

    IsRows(GridRangeInfoList)

    Returns true if all the GridRangeInfo in this list is of Type Row, otherwise returns false.

    Declaration
    public bool IsRows(GridRangeInfoList rangeList)
    Parameters
    Type Name Description
    GridRangeInfoList rangeList
    Returns
    Type
    System.Boolean

    MoveColumns(Int32, Int32, Int32)

    Moves the given number of columns from one position to another.

    Declaration
    public void MoveColumns(int removeAtColumnIndex, int count, int insertAtColumnIndex)
    Parameters
    Type Name Description
    System.Int32 removeAtColumnIndex

    Source column index.

    System.Int32 count

    Number of columns to be moved.

    System.Int32 insertAtColumnIndex

    Destination column index.

    MoveRows(Int32, Int32, Int32)

    Moves given number of rows from one position to another.

    Declaration
    public void MoveRows(int removeAtRowIndex, int count, int insertAtRowIndex)
    Parameters
    Type Name Description
    System.Int32 removeAtRowIndex

    Source row index.

    System.Int32 count

    Number of rows to be moved.

    System.Int32 insertAtRowIndex

    Destination row index.

    OnBaseStylesMapChanged(EventArgs)

    Raises the BaseStylesMapChanged event.

    Declaration
    protected virtual void OnBaseStylesMapChanged(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    A System.EventArgs that contains the event data.

    OnCellModelsChanged(CollectionChangeEventArgs)

    Raises the CellModelsChanged event.

    Declaration
    protected virtual void OnCellModelsChanged(CollectionChangeEventArgs e)
    Parameters
    Type Name Description
    System.ComponentModel.CollectionChangeEventArgs e

    A System.ComponentModel.CollectionChangeEventArgs that contains the event data.

    OnCellRequestNavigate(CellRequestNavigateEventArgs)

    Declaration
    protected virtual void OnCellRequestNavigate(CellRequestNavigateEventArgs e)
    Parameters
    Type Name Description
    CellRequestNavigateEventArgs e

    OnClipboardCanCopy(GridCutPasteEventArgs)

    Raises the ClipboardCanCopy event.

    Declaration
    protected virtual void OnClipboardCanCopy(GridCutPasteEventArgs e)
    Parameters
    Type Name Description
    GridCutPasteEventArgs e

    A GridCutPasteEventArgs that contains the event data.

    OnClipboardCanCut(GridCutPasteEventArgs)

    Raises the ClipboardCanCut event.

    Declaration
    protected virtual void OnClipboardCanCut(GridCutPasteEventArgs e)
    Parameters
    Type Name Description
    GridCutPasteEventArgs e

    A GridCutPasteEventArgs that contains the event data.

    OnClipboardCanPaste(GridCutPasteEventArgs)

    Raises the ClipboardCanPaste event.

    Declaration
    protected virtual void OnClipboardCanPaste(GridCutPasteEventArgs e)
    Parameters
    Type Name Description
    GridCutPasteEventArgs e

    A GridCutPasteEventArgs that contains the event data.

    OnClipboardCopy(GridCutPasteEventArgs)

    Raises the ClipboardCopy event.

    Declaration
    protected virtual void OnClipboardCopy(GridCutPasteEventArgs e)
    Parameters
    Type Name Description
    GridCutPasteEventArgs e

    A GridCutPasteEventArgs that contains the event data.

    OnClipboardCut(GridCutPasteEventArgs)

    Raises the ClipboardCut event.

    Declaration
    protected virtual void OnClipboardCut(GridCutPasteEventArgs e)
    Parameters
    Type Name Description
    GridCutPasteEventArgs e

    A GridCutPasteEventArgs that contains the event data.

    OnClipboardPaste(GridCutPasteEventArgs)

    Raises the ClipboardPaste event.

    Declaration
    protected virtual void OnClipboardPaste(GridCutPasteEventArgs e)
    Parameters
    Type Name Description
    GridCutPasteEventArgs e

    A GridCutPasteEventArgs that contains the event data.

    OnClipboardPasted(GridCutPasteEventArgs)

    This event calls after Clipboard paste.

    Declaration
    protected virtual void OnClipboardPasted(GridCutPasteEventArgs e)
    Parameters
    Type Name Description
    GridCutPasteEventArgs e

    OnColumnsInserted(GridRangeInsertedEventArgs)

    Declaration
    protected virtual void OnColumnsInserted(GridRangeInsertedEventArgs e)
    Parameters
    Type Name Description
    GridRangeInsertedEventArgs e

    OnColumnsMoved(GridRangeMovedEventArgs)

    Declaration
    protected virtual void OnColumnsMoved(GridRangeMovedEventArgs e)
    Parameters
    Type Name Description
    GridRangeMovedEventArgs e

    OnColumnsRemoved(GridRangeRemovedEventArgs)

    Declaration
    protected virtual void OnColumnsRemoved(GridRangeRemovedEventArgs e)
    Parameters
    Type Name Description
    GridRangeRemovedEventArgs e

    OnCommitCellInfo(GridCommitCellInfoEventArgs)

    Declaration
    protected virtual void OnCommitCellInfo(GridCommitCellInfoEventArgs e)
    Parameters
    Type Name Description
    GridCommitCellInfoEventArgs e

    OnCommittedCellInfo(GridCommitCellInfoEventArgs)

    Declaration
    protected virtual void OnCommittedCellInfo(GridCommitCellInfoEventArgs e)
    Parameters
    Type Name Description
    GridCommitCellInfoEventArgs e

    OnContextMenuCreating()

    Declaration
    protected virtual ContextMenu OnContextMenuCreating()
    Returns
    Type
    System.Windows.Controls.ContextMenu

    OnCreateBaseStylesMap()

    This method is called the first time BaseStylesMap and no GridBaseStylesMap has been associated with the GridModel before.

    Declaration
    protected virtual GridBaseStylesMap OnCreateBaseStylesMap()
    Returns
    Type Description
    GridBaseStylesMap

    A GridBaseStylesMap object.

    OnCreateColumnWidths()

    Declaration
    protected virtual IPaddedEditableLineSizeHost OnCreateColumnWidths()
    Returns
    Type
    IPaddedEditableLineSizeHost

    OnCreateRowHeights()

    Declaration
    protected virtual IPaddedEditableLineSizeHost OnCreateRowHeights()
    Returns
    Type
    IPaddedEditableLineSizeHost

    OnOleDropAtRowCol(GridOleDropAtRowColEventArgs)

    Raises the OleDropAtRowCol event.

    Declaration
    protected virtual void OnOleDropAtRowCol(GridOleDropAtRowColEventArgs e)
    Parameters
    Type Name Description
    GridOleDropAtRowColEventArgs e

    A GridOleDropAtRowColEventArgs that contains the event data.

    OnOleDroppedData(EventArgs)

    Raises the OleDroppedData event.

    Declaration
    protected virtual void OnOleDroppedData(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    A System.EventArgs that contains the event data.

    OnParseCommonFormats(GridCellTextEventArgs)

    Declaration
    protected virtual void OnParseCommonFormats(GridCellTextEventArgs e)
    Parameters
    Type Name Description
    GridCellTextEventArgs e

    OnQueryBaseStyles(GridQueryBaseStylesEventArgs)

    Declaration
    protected virtual void OnQueryBaseStyles(GridQueryBaseStylesEventArgs e)
    Parameters
    Type Name Description
    GridQueryBaseStylesEventArgs e

    OnQueryCellFormattedText(GridCellTextEventArgs)

    Declaration
    protected virtual void OnQueryCellFormattedText(GridCellTextEventArgs e)
    Parameters
    Type Name Description
    GridCellTextEventArgs e

    OnQueryCellInfo(GridQueryCellInfoEventArgs)

    Declaration
    protected virtual void OnQueryCellInfo(GridQueryCellInfoEventArgs e)
    Parameters
    Type Name Description
    GridQueryCellInfoEventArgs e

    OnQueryCellModel(GridQueryCellModelEventArgs)

    Raises the QueryCellModel event.

    Declaration
    protected virtual void OnQueryCellModel(GridQueryCellModelEventArgs e)
    Parameters
    Type Name Description
    GridQueryCellModelEventArgs e

    A GridQueryCellModelEventArgs that contains the event data.

    OnQueryCellSpanBackgrounds(GridQueryCellSpanBackgroundsEventArgs)

    Declaration
    protected virtual void OnQueryCellSpanBackgrounds(GridQueryCellSpanBackgroundsEventArgs e)
    Parameters
    Type Name Description
    GridQueryCellSpanBackgroundsEventArgs e

    OnQueryCellText(GridCellTextEventArgs)

    Declaration
    protected virtual void OnQueryCellText(GridCellTextEventArgs e)
    Parameters
    Type Name Description
    GridCellTextEventArgs e

    OnQueryContextMenuInfo(GridQueryContextMenuInfoEventArgs)

    Declaration
    protected virtual void OnQueryContextMenuInfo(GridQueryContextMenuInfoEventArgs e)
    Parameters
    Type Name Description
    GridQueryContextMenuInfoEventArgs e

    OnQueryCoveredRange(GridQueryCoveredRangeEventArgs)

    Declaration
    protected virtual void OnQueryCoveredRange(GridQueryCoveredRangeEventArgs e)
    Parameters
    Type Name Description
    GridQueryCoveredRangeEventArgs e

    OnQueryDragDropMoveClearCells(CancelEventArgs)

    Raises the QueryDragDropMoveClearCells event.

    Declaration
    protected virtual void OnQueryDragDropMoveClearCells(CancelEventArgs e)
    Parameters
    Type Name Description
    System.ComponentModel.CancelEventArgs e

    A System.ComponentModel.CancelEventArgs that contains the event data.

    OnQueryOleDataSourceData(GridQueryOleDataSourceDataEventArgs)

    Declaration
    protected virtual void OnQueryOleDataSourceData(GridQueryOleDataSourceDataEventArgs e)
    Parameters
    Type Name Description
    GridQueryOleDataSourceDataEventArgs e

    OnRowsInserted(GridRangeInsertedEventArgs)

    Declaration
    protected virtual void OnRowsInserted(GridRangeInsertedEventArgs e)
    Parameters
    Type Name Description
    GridRangeInsertedEventArgs e

    OnRowsMoved(GridRangeMovedEventArgs)

    Declaration
    protected virtual void OnRowsMoved(GridRangeMovedEventArgs e)
    Parameters
    Type Name Description
    GridRangeMovedEventArgs e

    OnRowsRemoved(GridRangeRemovedEventArgs)

    Declaration
    protected virtual void OnRowsRemoved(GridRangeRemovedEventArgs e)
    Parameters
    Type Name Description
    GridRangeRemovedEventArgs e

    OnSaveCellFormattedText(GridCellTextEventArgs)

    Declaration
    protected virtual void OnSaveCellFormattedText(GridCellTextEventArgs e)
    Parameters
    Type Name Description
    GridCellTextEventArgs e

    OnSaveCellText(GridCellTextEventArgs)

    Declaration
    protected virtual void OnSaveCellText(GridCellTextEventArgs e)
    Parameters
    Type Name Description
    GridCellTextEventArgs e

    OnSelectionChanged(GridSelectionChangedEventArgs)

    Raises the SelectionChanged event.

    Declaration
    protected virtual void OnSelectionChanged(GridSelectionChangedEventArgs e)
    Parameters
    Type Name Description
    GridSelectionChangedEventArgs e

    A GridSelectionChangedEventArgs that contains the event data.

    OnSelectionChanging(GridSelectionChangingEventArgs)

    Raises the SelectionChanging event.

    Declaration
    protected virtual void OnSelectionChanging(GridSelectionChangingEventArgs e)
    Parameters
    Type Name Description
    GridSelectionChangingEventArgs e

    A GridSelectionChangingEventArgs that contains the event data.

    OnUpdateAutoSizer(Boolean, Boolean)

    Declaration
    protected virtual void OnUpdateAutoSizer(bool applySizes, bool columnSizerChanged)
    Parameters
    Type Name Description
    System.Boolean applySizes
    System.Boolean columnSizerChanged

    RaiseOleDropAtRowCol(GridOleDropAtRowColEventArgs)

    Used internally.

    Declaration
    public void RaiseOleDropAtRowCol(GridOleDropAtRowColEventArgs e)
    Parameters
    Type Name Description
    GridOleDropAtRowColEventArgs e

    RaiseOleDroppedData(EventArgs)

    Used internally.

    Declaration
    public void RaiseOleDroppedData(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    RaiseParseCommonFormats(GridCellTextEventArgs)

    Used internally.

    Declaration
    public void RaiseParseCommonFormats(GridCellTextEventArgs e)
    Parameters
    Type Name Description
    GridCellTextEventArgs e

    The GridCellTextEventArgs.

    RaiseQueryCellFormattedText(GridCellTextEventArgs)

    Used internally.

    Declaration
    public void RaiseQueryCellFormattedText(GridCellTextEventArgs e)
    Parameters
    Type Name Description
    GridCellTextEventArgs e

    The GridCellTextEventArgs

    RaiseQueryCellModel(GridQueryCellModelEventArgs)

    Used internally.

    Declaration
    public void RaiseQueryCellModel(GridQueryCellModelEventArgs e)
    Parameters
    Type Name Description
    GridQueryCellModelEventArgs e

    The GridQueryCellModelEventArgs.

    RaiseQueryCellText(GridCellTextEventArgs)

    Used internally.

    Declaration
    public void RaiseQueryCellText(GridCellTextEventArgs e)
    Parameters
    Type Name Description
    GridCellTextEventArgs e

    The GridCellTextEventArgs.

    RaiseQueryContextMenuInfo(GridQueryContextMenuInfoEventArgs)

    Declaration
    public void RaiseQueryContextMenuInfo(GridQueryContextMenuInfoEventArgs e)
    Parameters
    Type Name Description
    GridQueryContextMenuInfoEventArgs e

    RaiseQueryDragDropMoveClearCells(CancelEventArgs)

    Used internally.

    Declaration
    public void RaiseQueryDragDropMoveClearCells(CancelEventArgs e)
    Parameters
    Type Name Description
    System.ComponentModel.CancelEventArgs e

    RaiseQueryOleDataSourceData(GridQueryOleDataSourceDataEventArgs)

    Declaration
    public void RaiseQueryOleDataSourceData(GridQueryOleDataSourceDataEventArgs e)
    Parameters
    Type Name Description
    GridQueryOleDataSourceDataEventArgs e

    RaiseSaveCellFormattedText(GridCellTextEventArgs)

    Used internally.

    Declaration
    public void RaiseSaveCellFormattedText(GridCellTextEventArgs e)
    Parameters
    Type Name Description
    GridCellTextEventArgs e

    The GridCellTextEventArgs.

    RaiseSaveCellText(GridCellTextEventArgs)

    Used internally.

    Declaration
    public void RaiseSaveCellText(GridCellTextEventArgs e)
    Parameters
    Type Name Description
    GridCellTextEventArgs e

    The GridCellTextEventArgs.

    RemoveColumns(Int32, Int32)

    Removes given number of columns from the specified index.

    Declaration
    public virtual void RemoveColumns(int removeAtColumnIndex, int count)
    Parameters
    Type Name Description
    System.Int32 removeAtColumnIndex

    The column index.

    System.Int32 count

    Number of columns to be removed.

    RemoveColumnsCore(Int32, Int32, GridMoveCellsState)

    Declaration
    protected virtual void RemoveColumnsCore(int removeAtColumnIndex, int count, GridMoveCellsState moveCellsState)
    Parameters
    Type Name Description
    System.Int32 removeAtColumnIndex
    System.Int32 count
    GridMoveCellsState moveCellsState

    RemoveRows(Int32, Int32)

    Deletes given number of rows from the specified index.

    Declaration
    public virtual void RemoveRows(int removeAtRowIndex, int count)
    Parameters
    Type Name Description
    System.Int32 removeAtRowIndex

    The row index.

    System.Int32 count

    Number of rows to be removed.

    RemoveRowsCore(Int32, Int32, GridMoveCellsState)

    Declaration
    protected virtual void RemoveRowsCore(int removeAtRowIndex, int count, GridMoveCellsState moveCellsState)
    Parameters
    Type Name Description
    System.Int32 removeAtRowIndex
    System.Int32 count
    GridMoveCellsState moveCellsState

    ResizeColumnsToFit(GridRangeInfo, GridResizeToFitOptions)

    Resizes a range of columns to optimally fit contents of the specified range of cells and given options.

    Declaration
    public bool ResizeColumnsToFit(GridRangeInfo range, GridResizeToFitOptions options)
    Parameters
    Type Name Description
    GridRangeInfo range

    The range of cells to be analyzed.

    GridResizeToFitOptions options

    Specifies whether row or column headers should be included; if size can be reduced and if covered cells should be considered.

    Returns
    Type Description
    System.Boolean

    True if any changes were made; False if all sizes were already optimal.

    ResizeColumnsToFit(GridRangeInfo, GridResizeToFitOptions, Boolean)

    Declaration
    public bool ResizeColumnsToFit(GridRangeInfo range, GridResizeToFitOptions options, bool EnableOptimizedResize)
    Parameters
    Type Name Description
    GridRangeInfo range
    GridResizeToFitOptions options
    System.Boolean EnableOptimizedResize
    Returns
    Type
    System.Boolean

    ResizeRowsToFit(GridRangeInfo, GridResizeToFitOptions)

    Resizes a range of rows to optimally fit contents of the specified range of cells and given options.

    Declaration
    public bool ResizeRowsToFit(GridRangeInfo range, GridResizeToFitOptions options)
    Parameters
    Type Name Description
    GridRangeInfo range

    The range of cells to be analyzed.

    GridResizeToFitOptions options

    Specifies whether row or column headers should be included; if size can be reduced and if covered cells should be considered.

    Returns
    Type Description
    System.Boolean

    True if any changes were made; False if all sizes were already optimal.

    ResumeFormattedTextCalculation()

    Declaration
    protected virtual void ResumeFormattedTextCalculation()

    ResumeRecordUndo()

    Resume logging undo information.

    Declaration
    public void ResumeRecordUndo()

    Serialize(String)

    Serializes the specified properties in the GridModel.

    Declaration
    public virtual void Serialize(string fileName)
    Parameters
    Type Name Description
    System.String fileName

    SerializeAsString()

    Serializes the GridModel properties as string.

    Declaration
    public virtual string SerializeAsString()
    Returns
    Type Description
    System.String

    Serialized data as String

    SerializeToStream(TextWriter)

    Serializes to stream.

    Declaration
    public virtual void SerializeToStream(TextWriter textWriter)
    Parameters
    Type Name Description
    System.IO.TextWriter textWriter

    The text writer.

    SetCellInfo(Int32, Int32, GridStyleInfo, StyleModifyType)

    Applies the style for the specified row and column index based on the provided StyleModifyType.

    Declaration
    public bool SetCellInfo(int rowIndex, int colIndex, GridStyleInfo style, StyleModifyType modifyType)
    Parameters
    Type Name Description
    System.Int32 rowIndex

    The row index.

    System.Int32 colIndex

    The column index.

    GridStyleInfo style

    The GridStyleInfo object that holds cell information.

    StyleModifyType modifyType

    A StyleModifyType that specifies the style operation to be performed.

    Returns
    Type Description
    System.Boolean

    A System.Boolean that indicates if the style of the specied cell was applied successfully.

    Remarks

    If the specified cell is not in the grid, it creates the GridStyleInfo object for the row and column and add it to the GridStyleInfoStore.

    SetGridModelCommandManager(GridModel)

    Declaration
    protected virtual void SetGridModelCommandManager(GridModel gridModel)
    Parameters
    Type Name Description
    GridModel gridModel

    ShouldHideColumn(Int32, Boolean)

    Declaration
    protected virtual bool ShouldHideColumn(int colIndex, bool hide)
    Parameters
    Type Name Description
    System.Int32 colIndex
    System.Boolean hide
    Returns
    Type
    System.Boolean

    ShouldHideRow(Int32, Boolean)

    Declaration
    protected virtual bool ShouldHideRow(int rowIndex, bool hide)
    Parameters
    Type Name Description
    System.Int32 rowIndex
    System.Boolean hide
    Returns
    Type
    System.Boolean

    SuspendFormattedTextCalculation()

    Declaration
    protected virtual void SuspendFormattedTextCalculation()

    SuspendRecordUndo()

    Suspend logging undo information.

    Declaration
    public void SuspendRecordUndo()

    Events

    BaseStylesMapChanged

    Occurs when the reference for BaseStylesMap in GridModel has changed.

    Declaration
    public event EventHandler BaseStylesMapChanged
    Event Type
    Type
    System.EventHandler

    CellModelsChanged

    Occurs when the CellModels collection is changed.

    Declaration
    public event CollectionChangeEventHandler CellModelsChanged
    Event Type
    Type
    System.ComponentModel.CollectionChangeEventHandler

    CellRequestNavigate

    Declaration
    public event CellRequestNavigateEventHandler CellRequestNavigate
    Event Type
    Type
    CellRequestNavigateEventHandler

    ClipboardCanCopy

    Occurs when the Copy() is called on the CutPaste component of a GridModel.

    Declaration
    public event GridCutPasteEventHandler ClipboardCanCopy
    Event Type
    Type
    GridCutPasteEventHandler

    ClipboardCanCut

    Occurs when the Cut() is called on the CutPaste component of a GridModel.

    Declaration
    public event GridCutPasteEventHandler ClipboardCanCut
    Event Type
    Type
    GridCutPasteEventHandler

    ClipboardCanPaste

    Occurs when the CanPaste() is called on the CutPaste component of a GridModel.

    Declaration
    public event GridCutPasteEventHandler ClipboardCanPaste
    Event Type
    Type
    GridCutPasteEventHandler

    ClipboardCopy

    Occurs when the Copy() is called on the CutPaste component of a GridModel.

    Declaration
    public event GridCutPasteEventHandler ClipboardCopy
    Event Type
    Type
    GridCutPasteEventHandler

    ClipboardCut

    Occurs when the CanCut() is called on the CutPaste component of a GridModel.

    Declaration
    public event GridCutPasteEventHandler ClipboardCut
    Event Type
    Type
    GridCutPasteEventHandler

    ClipboardPaste

    Occurs when the Paste() is called on the CutPaste component of a GridModel.

    Declaration
    public event GridCutPasteEventHandler ClipboardPaste
    Event Type
    Type
    GridCutPasteEventHandler

    ClipboardPasted

    Declaration
    public event GridCutPasteEventHandler ClipboardPasted
    Event Type
    Type
    GridCutPasteEventHandler

    ColumnsInserted

    Occurs after a range of columns has been inserted. See GridRangeInsertedEventArgs for more details.

    Declaration
    public event GridRangeInsertedEventHandler ColumnsInserted
    Event Type
    Type
    GridRangeInsertedEventHandler

    ColumnsMoved

    Occurs after a range of columns has been moved. See GridRangeMovedEventArgs for more details.

    Declaration
    public event GridRangeMovedEventHandler ColumnsMoved
    Event Type
    Type
    GridRangeMovedEventHandler

    ColumnsRemoved

    Occurs after a range of columns has been removed. See GridRangeRemovedEventArgs for more details.

    Declaration
    public event GridRangeRemovedEventHandler ColumnsRemoved
    Event Type
    Type
    GridRangeRemovedEventHandler

    CommitCellInfo

    Occurs when the model is about to save style information about a specific cell.

    Declaration
    public event GridCommitCellInfoEventHandler CommitCellInfo
    Event Type
    Type
    GridCommitCellInfoEventHandler

    CommittedCellInfo

    Occurs after the model has saved the style information about a specific cell.

    Declaration
    public event GridCommitCellInfoEventHandler CommittedCellInfo
    Event Type
    Type
    GridCommitCellInfoEventHandler

    Disposing

    Occurs when this component is about to be disposed.

    Declaration
    public event EventHandler Disposing
    Event Type
    Type
    System.EventHandler

    OleDropAtRowCol

    Declaration
    public event GridOleDropAtRowColEventHandler OleDropAtRowCol
    Event Type
    Type
    GridOleDropAtRowColEventHandler

    OleDroppedData

    Occurs after the user releases the mouse over a cell at the end of an OLE drag-and-drop operation and the data were applied to the grid.

    Declaration
    public event EventHandler OleDroppedData
    Event Type
    Type
    System.EventHandler

    OperationFeedback

    Occurs when an operation takes a longer time and the user should be notified about its status and have a chance to abort.

    Declaration
    public event OperationFeedbackEventHandler OperationFeedback
    Event Type
    Type
    OperationFeedbackEventHandler
    Remarks

    See OperationFeedbackEventArgs for more detailed discussion about this event.

    ParseCommonFormats

    Handle this event to provide support for parsing the formatted string and convert it into the the underlying cell's value.

    Declaration
    public event GridCellTextEventHandler ParseCommonFormats
    Event Type
    Type
    GridCellTextEventHandler

    QueryBaseStyles

    Occurs when the model queries information about a base style.

    Declaration
    public event GridQueryBaseStylesEventHandler QueryBaseStyles
    Event Type
    Type
    GridQueryBaseStylesEventHandler

    QueryCellFormattedText

    Occurs each time the GridStyleInfo.Text is called to get the string that represents the underlying cell's value.

    Declaration
    public event GridCellTextEventHandler QueryCellFormattedText
    Event Type
    Type
    GridCellTextEventHandler

    QueryCellInfo

    Occurs when the model queries for style information about a specific cell. This event allows you to customize cell contents at run-time on demand, just before the cell is drawn

    Declaration
    public event GridQueryCellInfoEventHandler QueryCellInfo
    Event Type
    Type
    GridQueryCellInfoEventHandler

    QueryCellModel

    Occurs when the QueryCellModel is querying for the GridCellModelBase and the cell type is not found in the GridCellModelCollection.

    Declaration
    public event GridQueryCellModelEventHandler QueryCellModel
    Event Type
    Type
    GridQueryCellModelEventHandler
    Remarks

    The GridModel has a table with all cell types used in the grid. Whenever the grid encounters a new cell type that it cannot find in the table it will raise a QueryCellModel event. The CellType identifies the name of the cell type. The CellModel should receive the new instance of the associated cell object. This object will be stored in the table together with its name and reused among cells with the same CellType.

    You should process this event if you want to add custom cell types and initialize these cell types on demand when associated cells are accessed the first time.

    See Also
    GridQueryCellModelEventHandler

    QueryCellSpanBackgrounds

    Occurs when the model queries information about a spanned background at a specific cell.

    Declaration
    public event GridQueryCellSpanBackgroundsEventHandler QueryCellSpanBackgrounds
    Event Type
    Type
    GridQueryCellSpanBackgroundsEventHandler

    QueryCellText

    Occurs each time the GridStyleInfo.Text is called to get the string that represents the underlying cell's value.

    Declaration
    public event GridCellTextEventHandler QueryCellText
    Event Type
    Type
    GridCellTextEventHandler

    QueryContextMenuInfo

    Declaration
    public event GridQueryContextMenuInfoEventHandler QueryContextMenuInfo
    Event Type
    Type
    GridQueryContextMenuInfoEventHandler

    QueryCoveredRange

    Occurs when the model queries information about a covered range at a specific cell.

    Declaration
    public event GridQueryCoveredRangeEventHandler QueryCoveredRange
    Event Type
    Type
    GridQueryCoveredRangeEventHandler

    QueryDragDropMoveClearCells

    Occurs when the user drops data onto another control using OLE drag-and-drop and does not press the Control Key. Set e.Cancel = True for this event if you do not want the grid to clear cell contents of the dragged cells.

    Declaration
    public event CancelEventHandler QueryDragDropMoveClearCells
    Event Type
    Type
    System.ComponentModel.CancelEventHandler

    QueryOleDataSourceData

    Declaration
    public event GridQueryOleDataSourceDataEventHandler QueryOleDataSourceData
    Event Type
    Type
    GridQueryOleDataSourceDataEventHandler

    RowsInserted

    Occurs after a range of rows has been inserted. See GridRangeInsertedEventArgs for more details.

    Declaration
    public event GridRangeInsertedEventHandler RowsInserted
    Event Type
    Type
    GridRangeInsertedEventHandler

    RowsMoved

    Occurs after a range of rows has been moved. See GridRangeMovedEventArgs for more details.

    Declaration
    public event GridRangeMovedEventHandler RowsMoved
    Event Type
    Type
    GridRangeMovedEventHandler

    RowsRemoved

    Occurs when a range of rows is removed. See GridRangeRemovedEventArgs for more details.

    Declaration
    public event GridRangeRemovedEventHandler RowsRemoved
    Event Type
    Type
    GridRangeRemovedEventHandler

    SaveCellFormattedText

    Occurs each time the GridStyleInfo.FormattedText is called to set the raw string that represents the underlying cell's value.

    Declaration
    public event GridCellTextEventHandler SaveCellFormattedText
    Event Type
    Type
    GridCellTextEventHandler

    SaveCellText

    Occurs each time the GridStyleInfo.Text is called to set the raw string that represents the underlying cell's value.

    Declaration
    public event GridCellTextEventHandler SaveCellText
    Event Type
    Type
    GridCellTextEventHandler

    SelectionChanged

    Occurs after the model updates its internal data structures when the model in the process of selecting a range of cells as a result of a SelectRange(GridRangeInfo, Boolean).

    Declaration
    public event GridSelectionChangedEventHandler SelectionChanged
    Event Type
    Type
    GridSelectionChangedEventHandler
    Remarks

    The GridModel will raise a SelectionChanging event before it updates its internal data structures and a SelectionChanged event after afterwards. A GridControlBase grid listens to this event and outline the selected range of cells.

    SelectionChanging

    Occurs before the model updates internal data structures when the model in the process of selecting a range of cells as a result of a SelectRange(GridRangeInfo, Boolean).

    Declaration
    public event GridSelectionChangingEventHandler SelectionChanging
    Event Type
    Type
    GridSelectionChangingEventHandler
    Remarks

    The GridModel will raise a SelectionChanging event before it updates its internal data structures and a SelectionChanged event afterwards. A GridControlBase grid listens to this event and outlines the selected range of cells.

    You can disallow the selection of specific cells at run-time when you assign true to System.ComponentModel.CancelEventArgs.Cancel.

    You can also modify the Range to include additional cells.

    See Also
    GridSelectionChangingEventHandler
    GridSelectionChangedEventArgs

    Explicit Interface Implementations

    IOperationFeedbackProvider.FeedbackStack

    Declaration
    Stack IOperationFeedbackProvider.FeedbackStack { get; }
    Returns
    Type
    System.Collections.Stack

    IOperationFeedbackProvider.RaiseOperationFeedbackEvent(OperationFeedbackEventArgs)

    Declaration
    void IOperationFeedbackProvider.RaiseOperationFeedbackEvent(OperationFeedbackEventArgs e)
    Parameters
    Type Name Description
    OperationFeedbackEventArgs e

    IGridVolatileCellStylesHost.CommitCellInfo(RowColumnIndex, GridStyleInfo, StyleInfoProperty)

    Declaration
    void IGridVolatileCellStylesHost.CommitCellInfo(RowColumnIndex cell, GridStyleInfo style, StyleInfoProperty sip)
    Parameters
    Type Name Description
    RowColumnIndex cell
    GridStyleInfo style
    StyleInfoProperty sip

    IGridVolatileCellStylesHost.LookupCellModel(String)

    Declaration
    GridCellModelBase IGridVolatileCellStylesHost.LookupCellModel(string id)
    Parameters
    Type Name Description
    System.String id
    Returns
    Type
    GridCellModelBase

    IGridVolatileCellStylesHost.QueryBaseStyles(RowColumnIndex, GridStyleInfo)

    Declaration
    IStyleInfo[] IGridVolatileCellStylesHost.QueryBaseStyles(RowColumnIndex cell, GridStyleInfo style)
    Parameters
    Type Name Description
    RowColumnIndex cell
    GridStyleInfo style
    Returns
    Type
    IStyleInfo[]

    IGridVolatileCellStylesHost.QueryCellInfo(RowColumnIndex, GridStyleInfo)

    Declaration
    void IGridVolatileCellStylesHost.QueryCellInfo(RowColumnIndex cell, GridStyleInfo style)
    Parameters
    Type Name Description
    RowColumnIndex cell
    GridStyleInfo style

    Implements

    IGridVolatileCellStylesHost
    IOperationFeedbackProvider
    System.IDisposable

    Extension Methods

    GridModelExportExtensions.ExportToExcel(GridModel, GridRangeInfo, ExcelEngine, Int32, IRange)
    GridModelExportExtensions.ExportToExcel(GridModel, GridRangeInfo, ExcelEngine, Int32, IRange, GridCellExportToExcelHandler)
    GridModelExportExtensions.ExportToExcel(GridModel, String, ExcelVersion)
    GridModelExportExtensions.ExportToExcel(GridModel, String, ExcelVersion, GridCellExportToExcelHandler)
    GridModelExportExtensions.ExportToExcel(GridModel, IWorksheet, ExcelExportingOptions)
    GridModelExportExtensions.ExportToExcel(GridModel, GridRangeInfo, IWorksheet, IRange)
    GridModelExportExtensions.ExportToExcel(GridModel, GridRangeInfo, IWorksheet, IRange, GridCellExportToExcelHandler)
    GridModelExportExtensions.ExportToExcel(GridModel, GridRangeInfo, IWorksheet, IRange, ExcelExportingOptions)
    GridModelExportExtensions.ExportToCSV(GridModel, String)
    GridModelExportExtensions.ExportToCSV(GridModel, GridRangeInfo, String)
    GridModelImportExtensions.ImportFromExcel(GridModel, Stream)
    GridModelImportExtensions.ImportFromExcel(GridModel, Stream, GridCellImportFromExcelHandler)
    GridModelImportExtensions.ImportFromExcel(GridModel, String)
    GridModelImportExtensions.ImportFromExcel(GridModel, String, GridCellImportFromExcelHandler)
    GridModelImportExtensions.ImportFromExcel(GridModel, IWorksheet)
    GridModelImportExtensions.ImportFromExcel(GridModel, IWorksheet, GridCellImportFromExcelHandler)
    GridModelImportExtensions.ImportFromExcelToVirtualGrid(GridModel, IWorkbook, IWorksheet, GridCellImportFromExcelHandler)
    GridPdfExportExtension.ExportToPdfGridDocument(GridModel, GridRangeInfo)
    GridPdfExportExtension.ExportToPdfGridDocument(GridModel, GridRangeInfo, GridCellExportToPdfHandler)
    GridPdfExportExtension.ExportToPdfGridDocument(GridModel, GridRangeInfo, DrawPdfHeaderFooterEventHandler, DrawPdfHeaderFooterEventHandler)
    GridPdfExportExtension.ExportToPdfGridDocument(GridModel, GridRangeInfo, GridCellExportToPdfHandler, DrawPdfHeaderFooterEventHandler, DrawPdfHeaderFooterEventHandler)
    GridPdfExportExtension.ExportToPdfGridDocument(GridModel, GridRangeInfo, String)
    GridPdfExportExtension.ExportToPdfGridDocument(GridModel, GridRangeInfo, GridCellExportToPdfHandler, String)
    GridPdfExportExtension.ExportToPdfGridDocument(GridModel, GridRangeInfo, DrawPdfHeaderFooterEventHandler, DrawPdfHeaderFooterEventHandler, String)
    GridPdfExportExtension.ExportToPdfGridDocument(GridModel, GridRangeInfo, GridCellExportToPdfHandler, DrawPdfHeaderFooterEventHandler, DrawPdfHeaderFooterEventHandler, String)
    GridPdfExportExtension.ExportToPdfGrid(GridModel, GridRangeInfo)
    GridPdfExportExtension.ExportToPdfGrid(GridModel, GridRangeInfo, GridCellExportToPdfHandler)
    GridPdfExportExtension.ExportToPdf(GridModel, GridRangeInfo, ExportToPdfOptions)
    GridPdfExportExtension.ExportToPdfDocument(GridModel, GridRangeInfo, ExportToPdfOptions)
    GridPdfExportExtension.ExportToPdfLightTableDocument(GridModel, GridRangeInfo, String)
    GridPdfExportExtension.ExportToPdfLightTableDocument(GridModel, GridRangeInfo, DrawPdfHeaderFooterEventHandler, DrawPdfHeaderFooterEventHandler, String)
    GridPdfExportExtension.ExportToPdfLightTableDocument(GridModel, GridRangeInfo)
    GridPdfExportExtension.ExportToPdfLightTableDocument(GridModel, GridRangeInfo, DrawPdfHeaderFooterEventHandler, DrawPdfHeaderFooterEventHandler)
    GridPdfExportExtension.ExportToPdfLightTable(GridModel, GridRangeInfo)

    See Also

    GridControlBase
    GridControl
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved