menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridModel - WindowsForms 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
    GridDataBoundGridModel
    GridListControlModel
    GridGroupDropAreaModel
    GridTableModel
    Implements
    IOperationFeedbackProvider
    ICreateControl
    IGridModelSource
    System.Runtime.Serialization.ISerializable
    System.IDisposable
    System.Runtime.Serialization.IDeserializationCallback
    Namespace: Syncfusion.Windows.Forms.Grid
    Assembly: Syncfusion.Grid.Windows.dll
    Syntax
    public class GridModel : Component, IGridVolatileDataContainer, IOperationFeedbackProvider, ICreateControl, IGridModelSource, ISerializable, IDisposable, IDeserializationCallback
    Remarks

    A GridModel holds all data for a grid. You can initialize a GridModel and then attach it to one or more GridControlBase controls. If you share the same model among several GridControlBase controls, changes in the model will be automatically reflected in all associated controls.

    If the user makes changes in one control, e.g. row heights or cell contents, the changes will be stored in the GridModel and events are raised that notify all associated controls about changes in the model so that each view can update its contents. This follows the Model-View-Controller pattern where data is separated from view.

    GridModel offers many events that you can subscribe to and modify the default behavior of the grid. Typically, methods that are sent before the action is carried out allows you to adjust certain parameters or cancel the operation. These events usually end with an "ing" suffix, like "Changing". Events that are raised after the data in the model have been changed inform associated controls about the success of the operation. For example, if a GridControlBase receives a CellsChanged event, it will redraw the affected cells. Most of these events have a Success property that indicates if the operation finished successfully or failed to complete.

    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 if you are working on a grid that does not need to support several views sharing the same model.

    Constructors

    GridModel()

    Initializes a new instance of GridModel.

    Declaration
    public GridModel()

    GridModel(SerializationInfo, StreamingContext)

    Initializes a new GridModel from a serialization stream.

    Declaration
    protected GridModel(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info

    An object that holds all the data needed to serialize or deserialize this instance.

    System.Runtime.Serialization.StreamingContext context

    Describes the source and destination of the serialized stream specified by info.

    GridModel(Type)

    Initializes a new instance of GridModelclass.

    Declaration
    public GridModel(Type type)
    Parameters
    Type Name Description
    System.Type type

    The Type value.

    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(Boolean) and Activate(Int32, Int32) for the involved controls.

    AllowAdjustCellValue

    Gets or sets a value indicating whether the the CellValue should be converted to a specified CellValueType at the time CellValueType is set if CellValue is assigned to a cell before the CellValueType. Default is true for 4.1 and later. If this flag is not set the CellValueType will not be enforced on a previously set CellValue.

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

    AllowNewGridVolatileData

    Gets or sets a value indicating whether GridModel should use the newer GridNewVolatileData as the default volatile data store. This works only with .NET Framework 2.0 or higher and offers improved performance especially with virtual mode scenarios.

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

    BanneredRanges

    Gets bannered ranges in the grid.

    Declaration
    public GridModelBanneredRanges BanneredRanges { get; }
    Property Value
    Type
    GridModelBanneredRanges

    BaseStylesMap

    Gets or sets the GridBaseStylesMap that is associated with this GridModel.

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

    This example shows to use the BaseStyleMap property.

    // Cell value for all the grid cells will be changed as "Sample"
    this.gridControl1.Model.BaseStylesMap["Standard"].StyleInfo.CellValue = "Sample";
    // Backcolor for all the header cells (Row and Column) will be changed as "Red"
    this.gridControl1.Model.BaseStylesMap["Header"].StyleInfo.BackColor = Color.Red;
    ' Cell value for all the grid cells will be changed as "Sample"
    Me.gridControl1.Model.BaseStylesMap("Standard").StyleInfo.CellValue = "Sample"
    ' Backcolor for all the header cells (Row and Column) will be changed as "Red"
    Me.gridControl1.Model.BaseStylesMap("Header").StyleInfo.BackColor = Color.Red

    CanGridRaiseEvents

    Gets a value indicating whether raising events has been suspended.

    Declaration
    protected virtual bool CanGridRaiseEvents { get; }
    Property Value
    Type
    System.Boolean

    CellModels

    Gets cell types for the grid.

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

    This example shows how to use the CellModels property.

    //Specify the cell model to be added in the grid model with cell type name.
    this.gridControl1.CellModels.Add("SampleCellType", new GridHeaderCellModel(this.gridControl1.Model));
    // Set the added cell type to the cell.
     this.gridControl1.Model.ColStyles[1].CellType = "SampleCellType";
    'Specify the cell model to be added in the grid model with cell type name.
    Me.gridControl1.Model.CellModels.Add("SampleCellType", New GridHeaderCellModel(Me.gridControl1.Model))
    'Set the added cell type to the cell
    Me.gridControl1.Model.ColStyles(1).CellType = "SampleCellType"

    ColCount

    Gets or sets the number of columns in the grid. You can provide this value at run-time if you handle the QueryColCount or SaveColCount events.

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

    ColHiddenEntries

    Gets or sets a collection of GridColHidden objects. This collection is a wrapper collection for values in the HideCols object. It provides support for modifying values through a CollectionEditor and code serialization at design-time.

    Declaration
    public GridColHiddenCollection ColHiddenEntries { get; set; }
    Property Value
    Type
    GridColHiddenCollection

    Cols

    Gets column operations for the grid. Allows you to insert, move, remove columns, and more.

    Declaration
    public GridModelRowColOperations Cols { get; }
    Property Value
    Type
    GridModelRowColOperations

    ColStyles

    Gets column styles. Individual cells will inherit attributes from the corresponding column style.

    Declaration
    public GridModelColStylesIndexer ColStyles { get; }
    Property Value
    Type
    GridModelColStylesIndexer
    Examples

    This example shows how to use the ColStyles property.

    // Setting whole column's styles.
    this.gridControl1.Model.ColStyles[1].BackColor = Color.Red;
    this.gridControl1.Model.ColStyles[1].Font.Facename = "Segoe UI";
    this.gridControl1.Model.ColStyles[1].Font.Bold = true;
    ' Setting whole column's styles.
    Me.gridControl1.Model.ColStyles(1).BackColor = Color.Red
    Me.gridControl1.Model.ColStyles(1).Font.Facename = "Segoe UI"
    Me.gridControl1.Model.ColStyles(1).Font.Bold = True

    Columnlist

    Gets or Sets the StringCollection value to the Column list.

    Declaration
    public StringCollection Columnlist { get; set; }
    Property Value
    Type
    System.Collections.Specialized.StringCollection

    ColWidthEntries

    Gets or sets a collection of GridColWidth objects. This collection is a wrapper collection for values in the ColWidths object. It provides support for modifying values through a CollectionEditor and code serialization at design-time.

    Declaration
    public GridColWidthCollection ColWidthEntries { get; set; }
    Property Value
    Type
    GridColWidthCollection

    ColWidths

    Gets column widths for the grid.

    Declaration
    public GridModelRowColSizeIndexer ColWidths { get; }
    Property Value
    Type
    GridModelRowColSizeIndexer

    CommandStack

    Gets undo and redo in the grid.

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

    This example shows how to use the CommandStack property.

    // Undo the actions in the grid.
    this.gridControl1.Model.CommandStack.Undo();
    //Redo the actions in the grid.
    this.gridControl1.Model.CommandStack.Redo();
    // Getting the current command mode of the grid.
    GridCommandMode commandMode = this.gridControl1.Model.CommandStack.Mode;
    ' Undo the actions in the grid.
    Me.gridControl1.Model.CommandStack.Undo()
    'Redo the actions in the grid.
    Me.gridControl1.Model.CommandStack.Redo()
    ' Getting the current command mode of the grid.
    Dim commandMode As GridCommandMode = Me.gridControl1.Model.CommandStack.Mode

    CoveredRanges

    Gets covered ranges in the grid.

    Declaration
    public GridModelCoveredRanges CoveredRanges { get; }
    Property Value
    Type
    GridModelCoveredRanges
    Examples

    This example shows how to use the CoveredRanges property.

    // Defining the covered range.
    GridRangeInfo coveredRange = GridRangeInfo.Cells(1, 2, 5, 5);
    // Adding the range to be covered.
    this.gridControl1.Model.CoveredRanges.Add(coveredRange);
    //Finding range of covered cells.
    GridRangeInfo range = this.gridControl1.Model.CoveredRanges.FindRange(e.RowIndex, e.ColIndex);
    // Check whether the current cell is covered or not.
    GridRangeInfo range;
    if(this.gridControl1.Model.CoveredRanges.Find(e.RowIndex,e.ColIndex,out range))
    {
      // TODO
      // TODO
    }
    ' Defining the covered range.
    Dim coveredRange As GridRangeInfo = GridRangeInfo.Cells(1, 2, 5, 5)
    ' Adding the range to be covered.
    Me.gridControl1.Model.CoveredRanges.Add(coveredRange)
    'Finding range of covered cells.
    Dim range As GridRangeInfo = Me.gridControl1.Model.CoveredRanges.FindRange(e.RowIndex, e.ColIndex)
    'Check whether the current cell is covered or not.
    Dim range As GridRangeInfo
    If Me.gridControl1.Model.CoveredRanges.Find(e.RowIndex,e.ColIndex,range) Then
       ' TODO
       ' TODO
    End If

    CurrentCellInfo

    Gets or sets information about position of current cell, current cell renderer, and last active grid control.

    Declaration
    public virtual GridCurrentCellInfo CurrentCellInfo { get; set; }
    Property Value
    Type
    GridCurrentCellInfo

    CurrentCellRenderer

    Gets the GridCellRendererBase for the current cell.

    Declaration
    public GridCellRendererBase CurrentCellRenderer { get; }
    Property Value
    Type
    GridCellRendererBase

    CutPaste

    Gets clipboard operations for the grid.

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

    Data

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

    Declaration
    public GridData Data { get; set; }
    Property Value
    Type
    GridData
    Remarks

    A DataChanged event is raised if you replace the Data.

    DataExchange

    Gets style data exchange for the grid. Lets you copy style information to a stream or clipboard and recreate the styles at a later time.

    Declaration
    public GridModelStyleDataExchange DataExchange { get; }
    Property Value
    Type
    GridModelStyleDataExchange

    DataProvider

    Gets or sets a one-stop place to subscribe to row count, column count, and QueryCellInfo events.

    Declaration
    public IGridModelDataProvider DataProvider { get; set; }
    Property Value
    Type
    IGridModelDataProvider
    Remarks

    You should implement IGridModelDataProvider if you want to receive QueryRowCount, QueryColCount, QueryCellInfo, and SaveCellInfo events.

    The methods in this interface are called before the named events are raised and thus give you a chance to control the event's behavior before other subscribers can handle it.

    You should assign a reference of your object to DataProvider in order to receive the method calls.

    DiscardReadOnly

    Gets or sets a value indicating whether to DiscardReadOnly. Use IgnoreReadOnly instead.

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

    DragDropData

    Gets DragDrop Data. Used internally.

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

    EnableGridListControlInComboBox

    Gets or sets whether the grid's combobox controls should contain GridListControl. The default value is false.

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

    EnableLegacyStyle

    Gets / sets the Legacy styles

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

    FileName

    Gets or sets the filename for saving the GridModel next time you call SaveBinary().

    Declaration
    public string FileName { get; set; }
    Property Value
    Type
    System.String

    FloatingCells

    Gets floating cells in the grid.

    Declaration
    public GridModelFloatingCells FloatingCells { get; }
    Property Value
    Type
    GridModelFloatingCells

    GridCells

    Gets or sets a collection of GridCellInfo objects. This collection is a wrapper collection for cells in the GridData object. It provides support for code serialization at design-time.

    Declaration
    public GridCellInfoCollection GridCells { get; set; }
    Property Value
    Type
    GridCellInfoCollection

    GridCellsRange

    Gets a GridRangeInfo with all cells in the grid, excluding row and column headers.

    Declaration
    public GridRangeInfo GridCellsRange { get; }
    Property Value
    Type
    GridRangeInfo

    GridModelEventsTarget

    Gets or sets GridModelEventsTarget. Redirects events defined in IGridModelEventsTarget to the specified object. Each event will first be called on GridModelEventsTarget before the actual event handler in this object is called.

    Declaration
    public IGridModelEventsTarget GridModelEventsTarget { get; set; }
    Property Value
    Type
    IGridModelEventsTarget

    HasBaseStylesMap

    Gets a value indicating whether BaseStylesMap has been associated with this GridModel.

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

    HasCurrentCellInfo

    Gets a value indicating whether information about current cell is available.

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

    HasData

    Gets a value indicating whether Data has been initialized.

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

    HideCols

    Gets hidden columns in the grid.

    Declaration
    public GridModelHideRowColsIndexer HideCols { get; }
    Property Value
    Type
    GridModelHideRowColsIndexer
    Examples
    // Hiding the first column.
    this.gridControl1.Model.HideCols[1] = true;
    // Removing the second column from hidden.
    this.gridControl1.Model.HideCols[4] = false;
    ' Hiding the first column.
    Me.gridControl1.Model.HideCols(1) = True
    ' Removing the second column from hidden.
    Me.gridControl1.Model.HideCols(4) = False

    HideRows

    Gets hidden rows in the grid.

    Declaration
    public GridModelHideRowColsIndexer HideRows { get; }
    Property Value
    Type
    GridModelHideRowColsIndexer
    Examples

    This example shows how to use the HideRows property.

    // Hiding the first row.
    this.gridControl1.Model.HideRows[1] = true;
    // Removing the first row from hidden.
    this.gridControl1.Model.HideRows [3] = false;
    ' Hiding the first row.
    Me.gridControl1.Model.HideRows(1) = True
    ' Removing the first row from hidden.
    Me.gridControl1.Model.HideRows (3) = False

    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

    Initializing

    Gets a value indicating whether BeginInit() was called.

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

    InRichTextEditMode

    Gets or Sets whether the RichtextBox is in EditMode.

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

    IsDisposed

    Gets a value indicating whether object has been disposed.

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

    IsDisposing

    Gets a value indicating whether true if object is executing Dispose() method call.

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

    IsUntitled

    Gets a value indicating whether FileName was specified.

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

    Item[Int32, Int32]

    Gets or sets the style information of a cell.

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

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

    Examples

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

                model[2, 2].Text = "Grid Demo";
                model[2, 2].Font.Bold = true;
                model[2, 2].Font.Size = 16;
                model[2, 2].HorizontalAlignment = GridHorizontalAlignment.Center;
                model[2, 2].VerticalAlignment = GridVerticalAlignment.Middle;
                model[2, 2].CellType = "Static";
                model[2, 2].Borders.All = new GridBorder(GridBorderStyle.Solid, Color.FromArgb(100, 238, 122, 3));
                model[2, 2].Interior = new BrushInfo(GradientStyle.PathEllipse, Color.FromArgb(100, 57, 73, 122), Color.FromArgb(237, 240, 247));

    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.

                GridStyleInfo standard = model.BaseStylesMap["Standard"].StyleInfo;
                standard.TextColor = Color.FromArgb(0, 21, 84);
                    Color color = model[1, 1].TextColor;
                    // model[1, 1].TextColor will return Color.FromArgb(0, 21, 84));

    MergeCells

    Gets merge cells in the grid.

    Declaration
    public GridModelMergeCells MergeCells { get; }
    Property Value
    Type
    GridModelMergeCells

    Model

    Gets IGridModelSource interface. Returns this.

    Declaration
    public GridModel Model { get; }
    Property Value
    Type
    GridModel

    Modified

    Gets or sets a value indicating whether the modified state of the grid. A ModifiedChanged event is raised when this property is changed.

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

    OperationFeedbackListener

    Gets or sets a feedback handler for the grid model to give visual feedback about time-consuming operations. Default handler for visual feedback are DelayedStatusDialog and DelayedWaitCursor.

    Declaration
    public OperationFeedbackListener OperationFeedbackListener { get; set; }
    Property Value
    Type
    OperationFeedbackListener
    Remarks

    If you want to provide visual feedback about progress of time-consuming operations you should assign feedback listener to OperationFeedbackListener. This could be done in your forms constructor or your derived classes constructor.

    See OperationFeedback for more in-depth discussion about operation feedback.

    Examples

    The following example initializes a DelayedStatusDialog as listener.

    Syncfusion.Windows.Forms.DelayedStatusDialog handler = new Syncfusion.Windows.Forms.DelayedStatusDialog();
    handler.Delay = 1000;
    handler.ShowDialogPercentRule = 25; //default
    handler.ShowMousePercentRule = 75; //default values
    this.gridControl1.Model.OperationFeedbackListener = handler;
    See Also
    OperationFeedbackListener
    OperationFeedback

    Options

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

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

    Properties

    Gets or sets more options for the grid. Printing related. Also manages colors for grid background, grid lines, and more.

    Declaration
    public GridProperties Properties { get; set; }
    Property Value
    Type
    GridProperties

    RangeStyles

    Gets or sets a collection of GridRangeStyle objects. This collection is a wrapper collection for cells in the GridData object. It provides support for modifying cells through a CollectionEditor and code serialization at design-time.

    Declaration
    public GridRangeStyleCollection RangeStyles { get; set; }
    Property Value
    Type
    GridRangeStyleCollection

    ReadOnly

    Gets or sets a value indicating whether the grid is in Read-only state.

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

    RecordFilterCollection

    Gets or Sets the StringCollection value to the RecordFilterCollection.

    Declaration
    public StringCollection RecordFilterCollection { get; set; }
    Property Value
    Type
    System.Collections.Specialized.StringCollection

    RowCount

    Gets or sets the number of rows in the grid. You can provide this value at run-time if you handle the QueryRowCount or SaveRowCount events.

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

    RowHeightEntries

    Gets or sets a collection of GridRowHeight objects. This collection is a wrapper collection for values in the RowHeights object. It provides support for modifying values through a CollectionEditor and code serialization at design-time.

    Declaration
    public GridRowHeightCollection RowHeightEntries { get; set; }
    Property Value
    Type
    GridRowHeightCollection

    RowHeights

    Gets row heights for the grid.

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

    RowHiddenEntries

    Gets or sets a collection of GridRowHidden objects. This collection is a wrapper collection for values in the HideRows object. It provides support for modifying values through a CollectionEditor and code serialization at design-time.

    Declaration
    public GridRowHiddenCollection RowHiddenEntries { get; set; }
    Property Value
    Type
    GridRowHiddenCollection

    Rows

    Gets row operations for the grid. Allows you to insert, move, remove rows, and more.

    Declaration
    public GridModelRowColOperations Rows { get; }
    Property Value
    Type
    GridModelRowColOperations

    RowStyles

    Gets row styles. Individual cells will inherit attributes from the corresponding row style.

    Declaration
    public GridModelRowStylesIndexer RowStyles { get; }
    Property Value
    Type
    GridModelRowStylesIndexer
    Examples

    This example shows how to use the RowStyles property.

    // Setting whole Row’s styles.
    this.gridControl1.Model. RowStyles[1].BackColor = Color.Red;
    this.gridControl1.Model. RowStyles[1].Font.Facename = "Segoe UI";
    this.gridControl1.Model. RowStyles[1].Font.Bold = true;
    ' Setting whole Row’s styles.
    Me.gridControl1.Model.RowStyles(1).BackColor = Color.Red
    Me.gridControl1.Model.RowStyles(1).Font.Facename = "Segoe UI"
    Me.gridControl1.Model.RowStyles(1).Font.Bold = True

    ScrollableGridRangeInfo

    Gets a GridRangeInfo with all cells in the grid, excluding frozen rows and columns.

    Declaration
    public GridRangeInfo ScrollableGridRangeInfo { get; }
    Property Value
    Type
    GridRangeInfo

    SelectedRanges

    Gets Selected Ranges. Used internally.

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

    Selections

    Gets range selections in the grid.

    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

    SortedColumns

    Gets or Sets the StringCollection value to the SortedColumns.

    Declaration
    public StringCollection SortedColumns { get; set; }
    Property Value
    Type
    System.Collections.Specialized.StringCollection

    TableStyle

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

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

    This example shows how to use the TableStyle property.

    this.gridControl1.Model.TableStyle.TextColor = Color.Red;
    this.gridControl1.Model.TableStyle.Font.Facename = "Segoe UI";
    this.gridControl1.Model.TableStyle.Font.Size = 15;
    Me.gridControl1.Model.TableStyle.TextColor = Color.Red
    Me.gridControl1.Model.TableStyle.Font.Facename = "Segoe UI"
    Me.gridControl1.Model.TableStyle.Font.Size = 15

    TextDataExchange

    Gets text data exchange for the grid. Lets you copy cell text to a stream or clipboard and recreate the cell text at a later time.

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

    UpdateOptions

    Gets the painting support during the BeginUpdate, EndUpdate batch.

    Declaration
    public BeginUpdateOptions UpdateOptions { get; }
    Property Value
    Type
    BeginUpdateOptions

    Updating

    Gets a value indicating whether BeginUpdate() has been called.

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

    UserData

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

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

    VolatileData

    Gets or sets IGridData that defines an interface that GridStyleInfoIdentity utilizes to query cell contents and base styles, look up cell types, and save changes back to the grid.

    Declaration
    public IGridData VolatileData { get; set; }
    Property Value
    Type
    IGridData

    WarnOnRecursionLevel

    Gets or sets RecursionLevel. If you handle the QueryCellInfo event and access other cells of the grid, there is a danger that you start an infinite recursion when you access the same cell in the grid for which OnQueryCellInfo(GridQueryCellInfoEventArgs) was called.

    GetCellInfo(Int32, Int32, GridStyleInfo) checks the recursion level. If the level is greater than WarnOnRecursionLevel, an exception is thrown. The default is 6.

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

    Methods

    AddBorders(Size, GridStyleInfo)

    Adds border margins to given cell client area size. The borders are determined from a specified style with cell content information.

    Declaration
    public Size AddBorders(Size size, GridStyleInfo style)
    Parameters
    Type Name Description
    System.Drawing.Size size

    The System.Drawing.Size with the cell size.

    GridStyleInfo style

    The GridStyleInfo object that holds cell information.

    Returns
    Type Description
    System.Drawing.Size

    The System.Drawing.Size with the cell size including its borders.

    BeginInit()

    Implements System.ComponentModel.ISupportInitialize.BeginInit of the System.ComponentModel.ISupportInitialize interface.

    Declaration
    public void BeginInit()

    BeginUpdate()

    Suspends the painting of associated grid controls until the EndUpdate() method is called.

    Declaration
    public void BeginUpdate()
    Remarks

    When many paints are made to the appearance of a control, you should invoke the BeginUpdate method to temporarily freeze the drawing of the control. This results in less distraction to the user, and a performance gain. After all updates have been made, invoke the EndUpdate method to resume drawing of the control.

    Pass BeginUpdateOptions if you do not want to do a complete Refresh of the control and instead want to have certain regions of your control be invalidated or scroll the contents of control.

    If you call BeginUpdate() and then later EndUpdate(), the control will know if a paint is pending and only refresh the control if a paint is pending. A call to ShouldPrepareUpdate, Invalidate, or a WM_PAINT message during the BeginUpdate EndUpdate block will signal the control that a paint is pending.

    This method will raise a BeginUpdateRequest event. Each attached GridControlBase listens to this event and calls BeginUpdate() for the current control.

    See Also
    EndUpdate()

    BeginUpdate(BeginUpdateOptions)

    Suspends the painting of associated grid controls until the EndUpdate() method is called.

    Declaration
    public void BeginUpdate(BeginUpdateOptions options)
    Parameters
    Type Name Description
    BeginUpdateOptions options

    Specifies the painting support during the BeginUpdate, EndUpdate batch.

    BeginUpdate(BeginUpdateOptions, String)

    Suspends the painting of associated grid controls until the EndUpdate() method is called and records a command description why painting is suspended.

    Declaration
    public virtual void BeginUpdate(BeginUpdateOptions options, string commandDesc)
    Parameters
    Type Name Description
    BeginUpdateOptions options

    Specifies the painting support during the BeginUpdate, EndUpdate batch.

    System.String commandDesc

    A description of the command.

    CalculatePreferredCellSize(Graphics, Int32, Int32, GridQueryBounds)

    Calculates the preferred size of the cell based on its contents, including margins and any buttons.

    Declaration
    public Size CalculatePreferredCellSize(Graphics g, int rowIndex, int colIndex, GridQueryBounds queryBounds)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

    The System.Drawing.Graphics context of the canvas.

    System.Int32 rowIndex

    The row index.

    System.Int32 colIndex

    The column index.

    GridQueryBounds queryBounds

    Vertical or horizontal.

    Returns
    Type Description
    System.Drawing.Size

    The optimal size of the cell.

    CalculatePreferredCellSize(Graphics, Int32, Int32, GridStyleInfo, GridQueryBounds)

    Calculates the preferred size of the cell based on its contents, including margins and any buttons.

    Declaration
    public Size CalculatePreferredCellSize(Graphics g, int rowIndex, int colIndex, GridStyleInfo style, GridQueryBounds queryBounds)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

    The System.Drawing.Graphics context of the canvas.

    System.Int32 rowIndex

    The row index.

    System.Int32 colIndex

    The column index.

    GridStyleInfo style

    The GridStyleInfo object that holds cell information.

    GridQueryBounds queryBounds

    Vertical or horizontal.

    Returns
    Type Description
    System.Drawing.Size

    The optimal size of the cell.

    CancelUpdate()

    Cancel any pending BeginUpdate calls.

    Declaration
    public void CancelUpdate()

    CanClearSelection()

    Determines if a range of cells is selected or if the grid has a current cell which contents can be cleared.

    Declaration
    public bool CanClearSelection()
    Returns
    Type Description
    System.Boolean

    True if clearing cells with Clear(Boolean) is possible; False otherwise.

    Remarks

    Use this to enable a "Clear" menu item or gray it out.

    ChangeCells(GridRangeInfo, GridStyleInfo)

    Determines whether can 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.

    Examples

    This example shows how to change the cells with the specified range and it's style.

    // Defining the new cell styles.
    GridStyleInfo newStyle = new GridStyleInfo();
    newStyle.CellType = GridCellTypeName.ComboBox;
    // Setting the styles of range of cells to new style.
    this.gridControl1.Model.ChangeCells(GridRangeInfo.Rows(1, 2), newStyle);
    ' Defining the new cell styles.
    Dim newStyle As New GridStyleInfo()
    newStyle.CellType = GridCellTypeName.ComboBox
    ' Setting the styles of range of cells to new style.
    Me.gridControl1.Model.ChangeCells(GridRangeInfo.Rows(1, 2), newStyle)

    ChangeCells(GridRangeInfo, GridStyleInfo, StyleModifyType)

    Determines whether can 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.

    Examples

    This example shows how to change the cells with the specified range and it's style.

    // Defining the new cell styles.
    GridStyleInfo newStyle = new GridStyleInfo();
    newStyle.CellType = GridCellTypeName.ComboBox;
    // Setting the styles of range of cells to new style.
    this.gridControl1.Model.ChangeCells(GridRangeInfo.Rows(1, 2), newStyle, Syncfusion.Styles.StyleModifyType.Changes);
    ' Defining the new cell styles.
    Dim newStyle As New GridStyleInfo()
    newStyle.CellType = GridCellTypeName.ComboBox
    ' Setting the styles of range of cells to new style.
    Me.gridControl1.Model.ChangeCells(GridRangeInfo.Rows(1, 2), newStyle, Syncfusion.Styles.StyleModifyType.Changes)

    ChangeCells(GridRangeInfo, GridStyleInfo[])

    Determines whether can 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.

    Examples

    This example shows how to change the cells with the specified range and it's style from the array of values.

    GridStyleInfo style1 = new GridStyleInfo();
    style2 = new GridStyleInfo();
    style2.BackColor = Color.Red;
    GridStyleInfo[] styles = { style1, style2 };
    GridRangeInfo range = GridRangeInfo.Rows(6, 7);
    this.gridControl1.Model.ChangeCells(range, styles);
    Dim style1 As New GridStyleInfo()
    style1.TextColor = Color.Blue
    Dim style2 As New GridStyleInfo()
    style2.BackColor = Color.Red
    Dim styles() As GridStyleInfo = { style1, style2 }
    Dim range As GridRangeInfo = GridRangeInfo.Rows(6, 7)
    Me.gridControl1.Model.ChangeCells(range, styles)

    ChangeCells(GridRangeInfo, GridStyleInfo[], StyleModifyType)

    Determines whether can applies an array of styles to the specified range of cells.

    Declaration
    public 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 CellsChanging and CellsChanged 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 created style with a bold font to a cell:

    GridStyleInfo boldFontStyle = new GridStyleInfo();
    boldFontStyle.TextColor =  Color.FromArgb(238, 122, 3);
    boldFontStyle.Font = boldFont;
    model[rowIndex, 1].Text = "Interior";
    model.ChangeCells(GridRangeInfo.Cell(rowIndex, 1), boldFontStyle);
    Dim boldFontStyle As New GridStyleInfo()
    boldFontStyle.TextColor = Color.FromArgb(238, 122, 3)
    boldFontStyle.Font = boldFont
    model(rowIndex, 1).Text = "Interior"
    model.ChangeCells(GridRangeInfo.Cell(rowIndex, 1), boldFontStyle)            

    ChangeCells(GridRangeInfo, String)

    Determines whether can 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.

    Examples

    This example shows how to change the cells with the specified range and text values.public bool ChangeCells(GridRangeInfo range, GridStyleInfo cellInfo)

    // The target range to set the text.
    GridRangeInfo range = GridRangeInfo.Cols(1, 2);
    //Setting the "SampleData" text to target range.
    this.gridControl1.Model.ChangeCells(range, "SampleData");
    ' The target range to set the text.
    Dim range As GridRangeInfo = GridRangeInfo.Cols(1, 2)
    'Setting the "SampleData" text to target range.
    Me.gridControl1.Model.ChangeCells(range, "SampleData")

    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.

    Clear(Boolean)

    Determines whether can clears all ranges in the current user selection.

    Declaration
    public bool Clear(bool clearStyle)
    Parameters
    Type Name Description
    System.Boolean clearStyle

    True if you want to clear all cell information; False if you only want to clear text.

    Returns
    Type Description
    System.Boolean

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

    ClearCells(GridRangeInfo, Boolean)

    Determines whether can clears a specified range of cells.

    Declaration
    public bool ClearCells(GridRangeInfo range, bool clearStyle)
    Parameters
    Type Name Description
    GridRangeInfo range

    The GridRangeInfo

    System.Boolean clearStyle

    True if you want to clear all cell information; False if you only want to clear text

    Returns
    Type Description
    System.Boolean

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

    ClearCells(GridRangeInfoList, Boolean)

    Determines whether can clears specified ranges of cells.

    Declaration
    public bool ClearCells(GridRangeInfoList rangeList, bool clearStyle)
    Parameters
    Type Name Description
    GridRangeInfoList rangeList

    A GridRangeInfoList that holds cells to be cleared.

    System.Boolean clearStyle

    True if you want to clear all cell information; False if you only want to clear text.

    Returns
    Type Description
    System.Boolean

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

    ConfirmChanges()

    Confirm pending changes in current cell.

    Declaration
    public void ConfirmChanges()

    ConfirmPendingChanges()

    Determines whether confirms any pending changes, raises the ConfirmingPendingChanges event, and calls the current cells ConfirmChanges() method.

    Declaration
    public bool ConfirmPendingChanges()
    Returns
    Type Description
    System.Boolean

    True if this action is successfully completed; False otherwise.

    CreateControl()

    Creates the control.

    Declaration
    public virtual Control CreateControl()
    Returns
    Type Description
    System.Windows.Forms.Control

    The control.

    CreateGraphics()

    Returns a display System.Drawing.Graphics object for this grid. You must dispose this object after use. The method will return null if ActiveGridView is null. In such case the GetGraphicsProvider() method is recommended.

    Declaration
    [Obsolete("It is recommended to use GetGraphicsProvider instead since this method will keep a Display Graphics context in memory if no active grid view is attached.")]
    public Graphics CreateGraphics()
    Returns
    Type Description
    System.Drawing.Graphics

    A System.Drawing.Graphics object.

    Remarks

    Raises a PrepareGraphics event.

    Examples

    The following shows how to use this method.

    IGraphicsProvider graphicsProvider = this.GetGraphicsProvider();  // It is important to hold onto this object as long ad Graphics context is needed!
    Graphics g = graphicsProvider.Graphics;   // Do not dispose this object! It is a cached Display Device context.
    // If nested method calls do call GetGraphicsProvider and get a graphics context the
    // same cached graphics context can be returned.
    Dim graphicsProvider as IGraphicsProvider = this.GetGraphicsProvider()  ' It is important to hold onto this object as long ad Graphics context is needed!
    Dim g as Graphics = graphicsProvider.Graphics   ' Do not dispose this object! It is a cached Display Device context.
    ' If nested method calls do call GetGraphicsProvider and get a graphics context the
    ' same cached graphics context can be returned.

    Dispose()

    Releases all the resources used by this component.

    Declaration
    public void Dispose()

    Dispose(Boolean)

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

    DoPrepareGraphics(Graphics)

    Raise a PrepareGraphics event.

    Declaration
    public void DoPrepareGraphics(Graphics g)
    Parameters
    Type Name Description
    System.Drawing.Graphics g

    Graphics object.

    EndEdit()

    Calls EndEdit() for the current cell.

    Declaration
    public void EndEdit()

    EndInit()

    Implements System.ComponentModel.ISupportInitialize.EndInit of the System.ComponentModel.ISupportInitialize interface.

    Declaration
    public void EndInit()

    EndUpdate()

    Resumes the painting of the control suspended by calling the BeginUpdate method.

    Declaration
    public void EndUpdate()
    Remarks

    When many paint are made to the appearance of a control, you should invoke the BeginUpdate method to temporarily freeze the drawing of the control. This results in less distraction to the user, and a performance gain. After all updates have been made, invoke the EndUpdate method to resume drawing of the control.

    This method will raise a EndUpdateRequest event. Each attached GridControlBase listens to this event and call EndUpdate() for the current control.

    EndUpdate(Boolean)

    Resumes the painting of the control suspended by calling the BeginUpdate method and allows you to specify whether current pending paint operations should be discarded.

    Declaration
    public virtual void EndUpdate(bool update)
    Parameters
    Type Name Description
    System.Boolean update

    Specifies whether current pending paint operations should be discarded.

    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 property

    Returns
    Type Description
    GridPropertyStandardValuesList

    A list with standard values / possible choices.

    GetCellInfo(Int32, Int32, GridStyleInfo)

    GetCellInfo raises a QueryCellInfo event to fill style contents and 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

    Always true.

    Remarks

    If QueryCellInfo did not set e.Handled, 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.

    IGridVolatileDataContainer.GetCellInfo calls GetCellInfo to return style information for a cell to the GridVolatileData cache.

    GetCells(GridRangeInfo)

    Gets a table that represents a range of cells.

    Declaration
    public GridStyleInfoStoreTable GetCells(GridRangeInfo range)
    Parameters
    Type Name Description
    GridRangeInfo range

    A GridRangeInfo that specifies the range of cells.

    Returns
    Type Description
    GridStyleInfoStoreTable

    A GridStyleInfoStoreTable object that holds contents for all the cells.

    See Also
    SetCells(GridRangeInfo, GridStyleInfoStoreTable)

    GetCellsInfo(GridRangeInfo)

    Returns the cell contents for a range of cells and stores them in an array.

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

    A GridRangeInfo that specifies the range of cells.

    Returns
    Type Description
    GridStyleInfo[]

    An array of GridStyleInfo object with cell information.

    GetCellsInfo(GridRangeInfo, OperationFeedback)

    Returns the cell contents for a range of cells and stores them in an array.

    Declaration
    public GridStyleInfo[] GetCellsInfo(GridRangeInfo range, OperationFeedback op)
    Parameters
    Type Name Description
    GridRangeInfo range

    A GridRangeInfo that specifies the range of cells.

    OperationFeedback op

    A OperationFeedback to provide feedback during time-consuming operations or to abort an operation.

    Returns
    Type Description
    GridStyleInfo[]

    An array of OperationFeedback that allows progress feedback. May be NULL.

    GetCombinedStyle(GridRangeInfo)

    Analyzes specified cells for attributes that are equal among the cells.

    Declaration
    public GridStyleInfo GetCombinedStyle(GridRangeInfo range)
    Parameters
    Type Name Description
    GridRangeInfo range

    A GridRangeInfo that specifies the range of cells.

    Returns
    Type Description
    GridStyleInfo

    The GridStyleInfo object that holds all attributes that were equal among cells.

    Examples

    The following example determines if Bold is enabled for a range of cells:

            GridStyleInfo style = GetCombinedStyle(GridRangeInfo.Cells(2, 2, 4, 8));
            bool isBold = style.Font.Bold;

    GetCombinedStyle(GridRangeInfoList)

    Analyzes specified cells for attributes that are equal among the cells.

    Declaration
    public GridStyleInfo GetCombinedStyle(GridRangeInfoList ranges)
    Parameters
    Type Name Description
    GridRangeInfoList ranges

    A GridRangeInfoList that specifies the ranges of cells.

    Returns
    Type Description
    GridStyleInfo

    The GridStyleInfo object that holds all attributes that were equal among cells.

    GetFixedLineBorder()

    Creates a GridBorder object generated using Options.DefaultGridBorderStyle and Properties.FixedLinesColor

    Declaration
    public virtual GridBorder GetFixedLineBorder()
    Returns
    Type Description
    GridBorder

    Grid border.

    GetGraphicsProvider()

    Returns a temporarily cached IGraphicsProvider object. The object creates a Graphics object on demand and raises a PrepareGraphics event. The graphics object gets automatically disposed once the IGraphicsProvider itself goes out of scope. Do not dispose this object yourself.

    Declaration
    public IGraphicsProvider GetGraphicsProvider()
    Returns
    Type Description
    IGraphicsProvider

    Graphics provider.

    GetGridLineBorder()

    Creates a GridBorder object generated using Options.DefaultGridBorderStyle and Properties.GridLineColor

    Declaration
    public virtual GridBorder GetGridLineBorder()
    Returns
    Type Description
    GridBorder

    Grid border.

    GetObjectData(SerializationInfo, StreamingContext)

    Returns the data needed to serialize the GridModel.

    Declaration
    protected virtual void GetObjectData(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info

    A SerializationInfo object containing the information required to serialize the object.

    System.Runtime.Serialization.StreamingContext context

    A StreamingContext object containing the source and destination of the serialized stream.

    GetSpannedRangeInfo(Int32, Int32, out GridRangeInfo)

    Determines spanned cell information for a given row and column. Spanned cells can be covered cells or floated cells.

    Declaration
    public virtual bool GetSpannedRangeInfo(int rowIndex, int colIndex, out GridRangeInfo range)
    Parameters
    Type Name Description
    System.Int32 rowIndex

    The row index.

    System.Int32 colIndex

    The column index.

    GridRangeInfo range

    A GridRangeInfo that specifies the range of cells.

    Returns
    Type Description
    System.Boolean

    A System.Boolean that indicates if a spanned range existed at the specified cell.

    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.DataSource is returned.

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

    The style object that holds the binding information.

    Returns
    Type Description
    System.Object

    Style datasource.

    InvalidateRange(GridRangeInfo, GridRangeOptions)

    Force all views to invalidate a specified range of cells.

    Declaration
    public virtual void InvalidateRange(GridRangeInfo range, GridRangeOptions options)
    Parameters
    Type Name Description
    GridRangeInfo range

    The range of cells to be repainted.

    GridRangeOptions options

    Options that indicate if method should enlarge the affected range of cells to include covered and floating cells.

    LoadBinary(Stream)

    Recreates a GridModel object from a System.IO.Stream with data in binary format.

    Declaration
    public static GridModel LoadBinary(Stream s)
    Parameters
    Type Name Description
    System.IO.Stream s

    A System.IO.Stream with data in binary format.

    Returns
    Type Description
    GridModel

    The recreated GridModel object.

    LoadBinary(String)

    Recreates a GridModel object from a file that holds data in binary format.

    Declaration
    public static GridModel LoadBinary(string fileName)
    Parameters
    Type Name Description
    System.String fileName

    The full pathname of the file.

    Returns
    Type Description
    GridModel

    The recreated GridModel object.

    LoadSoap(Stream)

    Recreates a GridModel object from a System.IO.Stream with data in SOAP format.

    Declaration
    public static GridModel LoadSoap(Stream s)
    Parameters
    Type Name Description
    System.IO.Stream s

    A System.IO.Stream with data in SOAP format.

    Returns
    Type Description
    GridModel

    The recreated GridModel object.

    LoadSoap(String)

    Recreates a GridModel object from a file that holds data in SOAP format.

    Declaration
    public static GridModel LoadSoap(string fileName)
    Parameters
    Type Name Description
    System.String fileName

    The full pathname of the file.

    Returns
    Type Description
    GridModel

    The recreated GridModel object.

    NameToColIndex(String)

    Returns the column index for a column that can be identified by the specified name.

    Declaration
    public virtual int NameToColIndex(string name)
    Parameters
    Type Name Description
    System.String name

    The name of the column.

    Returns
    Type Description
    System.Int32

    The column index; or -1 if column could not be resolved.

    Remarks

    The default behavior is that the name is recognized if in format C# (e.g. C10).

    If a DataProvider is attached to the grid (e.g. a GridModelDataBinder when using a GridDataBoundGrid), the name can be the fieldname in the underlying table.

    The following collections allow you to pass in names as identifiers:

    Items-Descriptions

    • Item[Int32] of the RowHeights and ColWidths collection.
    • Item[Int32] of HideRows and HideCols collection.
    • Item[Int32] of RowStyles and Item[Int32] of ColStyles collection.

    NameToRowIndex(String)

    Returns the row index for a row that can be identified by the specified name.

    Declaration
    public virtual int NameToRowIndex(string name)
    Parameters
    Type Name Description
    System.String name

    The name of the row.

    Returns
    Type Description
    System.Int32

    The row index; or -1 if row could not be resolved.

    Remarks

    The default behavior is that the name is recognized if in format R# (e.g. R10).

    The following collections allow you to pass in names as identifiers:

    Items-Descriptions

    • Item[Int32] of the RowHeights and ColWidths collection.
    • Item[Int32] of HideRows and HideCols collection.
    • Item[Int32] of RowStyles and Item[Int32] of ColStyles collection.

    NotifyCellsChanged(GridCellsChangedEventArgs)

    Raises the CellsChanged event.

    Declaration
    public void NotifyCellsChanged(GridCellsChangedEventArgs e)
    Parameters
    Type Name Description
    GridCellsChangedEventArgs e

    A GridCellsChangedEventArgs that contains the event data.

    NotifyCellsChanging(GridCellsChangingEventArgs)

    Raises the CellsChanging event.

    Declaration
    public bool NotifyCellsChanging(GridCellsChangingEventArgs e)
    Parameters
    Type Name Description
    GridCellsChangingEventArgs e

    A GridCellsChangingEventArgs that contains the event data.

    Returns
    Type Description
    System.Boolean

    True if the operation is successful.

    OnBanneredRangesChanged(GridBanneredRangesChangedEventArgs)

    Raises the BanneredRangesChanged event.

    Declaration
    protected virtual void OnBanneredRangesChanged(GridBanneredRangesChangedEventArgs e)
    Parameters
    Type Name Description
    GridBanneredRangesChangedEventArgs e

    A GridBanneredRangesChangedEventArgs that contains the event data.

    OnBanneredRangesChanging(GridBanneredRangesChangingEventArgs)

    Raises the BanneredRangesChanging event.

    Declaration
    protected virtual void OnBanneredRangesChanging(GridBanneredRangesChangingEventArgs e)
    Parameters
    Type Name Description
    GridBanneredRangesChangingEventArgs e

    An GridBanneredRangesChangingEventArgs that contains the event data.

    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.

    OnBeginUpdateRequest(EventArgs)

    Raises the BeginUpdateRequest event.

    Declaration
    protected virtual void OnBeginUpdateRequest(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.

    OnCellsChanged(GridCellsChangedEventArgs)

    Raises the CellsChanged event.

    Declaration
    protected virtual void OnCellsChanged(GridCellsChangedEventArgs e)
    Parameters
    Type Name Description
    GridCellsChangedEventArgs e

    A GridCellsChangedEventArgs that contains the event data.

    OnCellsChanging(GridCellsChangingEventArgs)

    Raises the CellsChanging event.

    Declaration
    protected virtual void OnCellsChanging(GridCellsChangingEventArgs e)
    Parameters
    Type Name Description
    GridCellsChangingEventArgs e

    A GridCellsChangingEventArgs that contains the event data.

    OnClearingCells(GridClearingCellsEventArgs)

    Raises the ClearingCells event.

    Declaration
    protected virtual void OnClearingCells(GridClearingCellsEventArgs e)
    Parameters
    Type Name Description
    GridClearingCellsEventArgs e

    A GridClearingCellsEventArgs that contains the event data.

    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.

    OnClipBoardCopyToBuffer(ClipboardCopyToBufferEventArgs)

    Raises the OnClipBoardCopyToBuffer(ClipboardCopyToBufferEventArgs) event.

    Declaration
    protected virtual void OnClipBoardCopyToBuffer(ClipboardCopyToBufferEventArgs e)
    Parameters
    Type Name Description
    ClipboardCopyToBufferEventArgs e

    A ClipboardCopyToBufferEventArgs 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)

    Raises the ClipboardPasted event.

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

    A GridCutPasteEventArgs that contains the event data.

    OnColsHidden(GridRowColHiddenEventArgs)

    Raises the ColsHidden event.

    Declaration
    protected virtual void OnColsHidden(GridRowColHiddenEventArgs e)
    Parameters
    Type Name Description
    GridRowColHiddenEventArgs e

    A GridRowColHiddenEventArgs that contains the event data.

    OnColsHiding(GridRowColHidingEventArgs)

    Raises the ColsHiding event.

    Declaration
    protected virtual void OnColsHiding(GridRowColHidingEventArgs e)
    Parameters
    Type Name Description
    GridRowColHidingEventArgs e

    A GridRowColHidingEventArgs that contains the event data.

    OnColsInserted(GridRangeInsertedEventArgs)

    Raises the ColsInserted event.

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

    A GridRangeInsertedEventArgs that contains the event data.

    OnColsInserting(GridRangeInsertingEventArgs)

    Raises the ColsInserting event.

    Declaration
    protected virtual void OnColsInserting(GridRangeInsertingEventArgs e)
    Parameters
    Type Name Description
    GridRangeInsertingEventArgs e

    A GridRangeInsertingEventArgs that contains the event data.

    OnColsMoved(GridRangeMovedEventArgs)

    Raises the ColsMoved event.

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

    A GridRangeMovedEventArgs that contains the event data.

    OnColsMoving(GridRangeMovingEventArgs)

    Raises the ColsMoving event.

    Declaration
    protected virtual void OnColsMoving(GridRangeMovingEventArgs e)
    Parameters
    Type Name Description
    GridRangeMovingEventArgs e

    A GridRangeMovingEventArgs that contains the event data.

    OnColsRemoved(GridRangeRemovedEventArgs)

    Raises the ColsRemoved event.

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

    A GridRangeRemovedEventArgs that contains the event data.

    OnColsRemoving(GridRangeRemovingEventArgs)

    Raises the ColsRemoving event.

    Declaration
    protected virtual void OnColsRemoving(GridRangeRemovingEventArgs e)
    Parameters
    Type Name Description
    GridRangeRemovingEventArgs e

    A GridRangeRemovingEventArgs that contains the event data.

    OnColWidthsChanged(GridRowColSizeChangedEventArgs)

    Raises the ColWidthsChanged event.

    Declaration
    protected virtual void OnColWidthsChanged(GridRowColSizeChangedEventArgs e)
    Parameters
    Type Name Description
    GridRowColSizeChangedEventArgs e

    A GridRowColSizeChangedEventArgs that contains the event data.

    OnColWidthsChanging(GridRowColSizeChangingEventArgs)

    Raises the ColWidthsChanging event.

    Declaration
    protected virtual void OnColWidthsChanging(GridRowColSizeChangingEventArgs e)
    Parameters
    Type Name Description
    GridRowColSizeChangingEventArgs e

    A GridRowColSizeChangingEventArgs that contains the event data.

    OnCommandStackChanged(EventArgs)

    Raises the CommandStackChanged event.

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

    An System.EventArgs that contains the event data.

    OnConfirmingPendingChanges(CancelEventArgs)

    Raises the ConfirmingPendingChanges event.

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

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

    Remarks

    Set System.ComponentModel.CancelEventArgs.Cancel to True if you can't confirm pending changes and want to abort the current operation.

    Some operations cannot be aborted, however.

    OnCoveredRangesChanged(GridCoveredRangesChangedEventArgs)

    Raises the CoveredRangesChanged event.

    Declaration
    protected virtual void OnCoveredRangesChanged(GridCoveredRangesChangedEventArgs e)
    Parameters
    Type Name Description
    GridCoveredRangesChangedEventArgs e

    A GridCoveredRangesChangedEventArgs that contains the event data.

    OnCoveredRangesChanging(GridCoveredRangesChangingEventArgs)

    Raises the CoveredRangesChanging event.

    Declaration
    protected virtual void OnCoveredRangesChanging(GridCoveredRangesChangingEventArgs e)
    Parameters
    Type Name Description
    GridCoveredRangesChangingEventArgs e

    A GridCoveredRangesChangingEventArgs that contains the event data.

    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.

    OnCreateData()

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

    Declaration
    public virtual GridData OnCreateData()
    Returns
    Type Description
    GridData

    A GridBaseStylesMap object.

    OnCreatedCutPaste()

    Called after the GridModelCutPaste object was created.

    Declaration
    protected virtual void OnCreatedCutPaste()

    OnDataChanged(EventArgs)

    Raises the DataChanged event.

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

    An System.EventArgs that contains the event data.

    OnDataProviderChanged(EventArgs)

    Raises the DataProviderChanged event.

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

    An System.EventArgs that contains the event data.

    OnDataProviderQueryCellInfo(GridQueryCellInfoEventArgs)

    Raises the DataProviderQueryCellInfo event.

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

    A GridQueryCellInfoEventArgs that contains the event data.

    OnDataProviderSaveCellInfo(GridSaveCellInfoEventArgs)

    Raises the DataProviderSaveCellInfo event.

    Declaration
    protected virtual void OnDataProviderSaveCellInfo(GridSaveCellInfoEventArgs e)
    Parameters
    Type Name Description
    GridSaveCellInfoEventArgs e

    A GridSaveCellInfoEventArgs that contains the event data.

    OnDefaultColWidthChanged(GridDefaultSizeChangedEventArgs)

    Raises the DefaultColWidthChanged event.

    Declaration
    protected virtual void OnDefaultColWidthChanged(GridDefaultSizeChangedEventArgs e)
    Parameters
    Type Name Description
    GridDefaultSizeChangedEventArgs e

    A GridDefaultSizeChangedEventArgs that contains the event data.

    OnDefaultColWidthChanging(GridDefaultSizeChangingEventArgs)

    Raises the DefaultColWidthChanging event.

    Declaration
    protected virtual void OnDefaultColWidthChanging(GridDefaultSizeChangingEventArgs e)
    Parameters
    Type Name Description
    GridDefaultSizeChangingEventArgs e

    A GridDefaultSizeChangingEventArgs that contains the event data.

    OnDefaultRowHeightChanged(GridDefaultSizeChangedEventArgs)

    Raises the DefaultRowHeightChanged event.

    Declaration
    protected virtual void OnDefaultRowHeightChanged(GridDefaultSizeChangedEventArgs e)
    Parameters
    Type Name Description
    GridDefaultSizeChangedEventArgs e

    A GridDefaultSizeChangedEventArgs that contains the event data.

    OnDefaultRowHeightChanging(GridDefaultSizeChangingEventArgs)

    Raises the DefaultRowHeightChanging event.

    Declaration
    protected virtual void OnDefaultRowHeightChanging(GridDefaultSizeChangingEventArgs e)
    Parameters
    Type Name Description
    GridDefaultSizeChangingEventArgs e

    A GridDefaultSizeChangingEventArgs that contains the event data.

    OnEndUpdateRequest(GridEndUpdateRequestEventArgs)

    Raises the EndUpdateRequest event.

    Declaration
    protected virtual void OnEndUpdateRequest(GridEndUpdateRequestEventArgs e)
    Parameters
    Type Name Description
    GridEndUpdateRequestEventArgs e

    A GridEndUpdateRequestEventArgs that contains the event data.

    OnFloatingCellsChanged(GridFloatingCellsChangedEventArgs)

    Raises the FloatingCellsChanged event.

    Declaration
    protected virtual void OnFloatingCellsChanged(GridFloatingCellsChangedEventArgs e)
    Parameters
    Type Name Description
    GridFloatingCellsChangedEventArgs e

    An GridFloatingCellsChangedEventArgs that contains the event data.

    OnFrozenColCountChanged(GridCountChangedEventArgs)

    Raises the FrozenColCountChanged event.

    Declaration
    protected virtual void OnFrozenColCountChanged(GridCountChangedEventArgs e)
    Parameters
    Type Name Description
    GridCountChangedEventArgs e

    A GridCountChangedEventArgs that contains the event data.

    OnFrozenColCountChanging(GridCountChangingEventArgs)

    Raises the FrozenColCountChanging event.

    Declaration
    protected virtual void OnFrozenColCountChanging(GridCountChangingEventArgs e)
    Parameters
    Type Name Description
    GridCountChangingEventArgs e

    A GridCountChangingEventArgs that contains the event data.

    OnFrozenRowCountChanged(GridCountChangedEventArgs)

    Raises the FrozenRowCountChanged event.

    Declaration
    protected virtual void OnFrozenRowCountChanged(GridCountChangedEventArgs e)
    Parameters
    Type Name Description
    GridCountChangedEventArgs e

    A GridCountChangedEventArgs that contains the event data.

    OnFrozenRowCountChanging(GridCountChangingEventArgs)

    Raises the FrozenRowCountChanging event.

    Declaration
    protected virtual void OnFrozenRowCountChanging(GridCountChangingEventArgs e)
    Parameters
    Type Name Description
    GridCountChangingEventArgs e

    A GridCountChangingEventArgs that contains the event data.

    OnHeaderColCountChanged(GridCountChangedEventArgs)

    Raises the HeaderColCountChanged event.

    Declaration
    protected virtual void OnHeaderColCountChanged(GridCountChangedEventArgs e)
    Parameters
    Type Name Description
    GridCountChangedEventArgs e

    A GridCountChangedEventArgs that contains the event data.

    OnHeaderColCountChanging(GridCountChangingEventArgs)

    Raises the HeaderColCountChanging event.

    Declaration
    protected virtual void OnHeaderColCountChanging(GridCountChangingEventArgs e)
    Parameters
    Type Name Description
    GridCountChangingEventArgs e

    A GridCountChangingEventArgs that contains the event data.

    OnHeaderRowCountChanged(GridCountChangedEventArgs)

    Raises the HeaderRowCountChanged event.

    Declaration
    protected virtual void OnHeaderRowCountChanged(GridCountChangedEventArgs e)
    Parameters
    Type Name Description
    GridCountChangedEventArgs e

    A GridCountChangedEventArgs that contains the event data.

    OnHeaderRowCountChanging(GridCountChangingEventArgs)

    Raises the HeaderRowCountChanging event.

    Declaration
    protected virtual void OnHeaderRowCountChanging(GridCountChangingEventArgs e)
    Parameters
    Type Name Description
    GridCountChangingEventArgs e

    A GridCountChangingEventArgs that contains the event data.

    OnInvalidateRangeRequest(GridInvalidateRangeRequestEventArgs)

    Raises the InvalidateRangeRequest event.

    Declaration
    protected virtual void OnInvalidateRangeRequest(GridInvalidateRangeRequestEventArgs e)
    Parameters
    Type Name Description
    GridInvalidateRangeRequestEventArgs e

    A GridInvalidateRangeRequestEventArgs that contains the event data.

    OnMergeCellsChanged(GridMergeCellsChangedEventArgs)

    Raises the MergeCellsChanged event.

    Declaration
    protected virtual void OnMergeCellsChanged(GridMergeCellsChangedEventArgs e)
    Parameters
    Type Name Description
    GridMergeCellsChangedEventArgs e

    An GridMergeCellsChangedEventArgs that contains the event data.

    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)

    Raises the ParseCommonFormats event.

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

    A GridCellTextEventArgs that contains the event data.

    OnPasteCellText(GridPasteCellTextEventArgs)

    Raises the PasteCellText event.

    Declaration
    protected virtual void OnPasteCellText(GridPasteCellTextEventArgs e)
    Parameters
    Type Name Description
    GridPasteCellTextEventArgs e

    A GridPasteCellTextEventArgs that contains the event data.

    OnPrepareChangeSelection(GridPrepareChangeSelectionEventArgs)

    Raises the PrepareChangeSelection event.

    Declaration
    protected virtual void OnPrepareChangeSelection(GridPrepareChangeSelectionEventArgs e)
    Parameters
    Type Name Description
    GridPrepareChangeSelectionEventArgs e

    A GridPrepareChangeSelectionEventArgs that contains the event data.

    OnPrepareClearSelection(EventArgs)

    Raises the PrepareClearSelection event.

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

    A System.EventArgs that contains the event data.

    OnPrepareGraphics(GraphicsEventArgs)

    Raises the PrepareGraphics event.

    Declaration
    protected virtual void OnPrepareGraphics(GraphicsEventArgs e)
    Parameters
    Type Name Description
    GraphicsEventArgs e

    A GraphicsEventArgs that contains the event data.

    Remarks

    Override this event if you want to customize the graphics context before a grid control draws to it.

    Examples

    The following example changes the System.Drawing.Graphics.TextRenderingHint of a System.Drawing.Graphics object to System.Drawing.Text.TextRenderingHint.ClearTypeGridFit:

    e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;

    OnQueryBanneredRange(GridQueryBanneredRangeEventArgs)

    Raises the QueryBanneredRange event.

    Declaration
    protected virtual void OnQueryBanneredRange(GridQueryBanneredRangeEventArgs e)
    Parameters
    Type Name Description
    GridQueryBanneredRangeEventArgs e

    A GridQueryBanneredRangeEventArgs that contains the event data.

    OnQueryCanMergeCells(GridQueryCanMergeCellsEventArgs)

    Raises the QueryCanMergeCells event.

    Declaration
    protected virtual void OnQueryCanMergeCells(GridQueryCanMergeCellsEventArgs e)
    Parameters
    Type Name Description
    GridQueryCanMergeCellsEventArgs e

    A GridQueryCanMergeCellsEventArgs that contains the event data.

    OnQueryCellFormattedText(GridCellTextEventArgs)

    Raises the QueryCellFormattedText event.

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

    A GridCellTextEventArgs that contains the event data.

    OnQueryCellInfo(GridQueryCellInfoEventArgs)

    Raises the QueryCellInfo event.

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

    A GridQueryCellInfoEventArgs that contains the event data.

    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.

    OnQueryCellText(GridCellTextEventArgs)

    Raises the QueryCellText event.

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

    A GridCellTextEventArgs that contains the event data.

    OnQueryColCount(GridRowColCountEventArgs)

    Raises the QueryColCount event.

    Declaration
    protected virtual void OnQueryColCount(GridRowColCountEventArgs e)
    Parameters
    Type Name Description
    GridRowColCountEventArgs e

    A GridRowColCountEventArgs that contains the event data.

    OnQueryColWidth(GridRowColSizeEventArgs)

    Raise the QueryColWidth event.

    Declaration
    protected virtual void OnQueryColWidth(GridRowColSizeEventArgs e)
    Parameters
    Type Name Description
    GridRowColSizeEventArgs e

    A GridRowColSizeEventArgs that contains the event data.

    OnQueryCoveredRange(GridQueryCoveredRangeEventArgs)

    Raises the QueryCoveredRange event.

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

    A GridQueryCoveredRangeEventArgs that contains the event data.

    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.

    OnQueryHideCol(GridRowColHideEventArgs)

    Raises the Syncfusion.Windows.Forms.Grid.GridModel.QueryHideCol event.

    Declaration
    protected virtual void OnQueryHideCol(GridRowColHideEventArgs e)
    Parameters
    Type Name Description
    GridRowColHideEventArgs e

    A GridRowColHideEventArgs that contains the event data.

    OnQueryHideRow(GridRowColHideEventArgs)

    Raises the Syncfusion.Windows.Forms.Grid.GridModel.QueryHideRow event.

    Declaration
    protected virtual void OnQueryHideRow(GridRowColHideEventArgs e)
    Parameters
    Type Name Description
    GridRowColHideEventArgs e

    A GridRowColHideEventArgs that contains the event data.

    OnQueryOleDataSourceData(GridQueryOleDataSourceDataEventArgs)

    Raises the QueryOleDataSourceData event.

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

    A GridQueryOleDataSourceDataEventArgs that contains the event data.

    OnQueryRowCount(GridRowColCountEventArgs)

    Raises the QueryRowCount event.

    Declaration
    protected virtual void OnQueryRowCount(GridRowColCountEventArgs e)
    Parameters
    Type Name Description
    GridRowColCountEventArgs e

    A GridRowColCountEventArgs that contains the event data.

    OnQueryRowHeight(GridRowColSizeEventArgs)

    Raise the QueryRowHeight event.

    Declaration
    protected virtual void OnQueryRowHeight(GridRowColSizeEventArgs e)
    Parameters
    Type Name Description
    GridRowColSizeEventArgs e

    A GridRowColSizeEventArgs that contains the event data.

    OnQueryRowHeightTotal(GridRowColSizeTotalEventArgs)

    Raise the QueryRowHeight event.

    Declaration
    protected virtual void OnQueryRowHeightTotal(GridRowColSizeTotalEventArgs e)
    Parameters
    Type Name Description
    GridRowColSizeTotalEventArgs e

    A GridRowColSizeTotalEventArgs that contains the event data.

    OnRowHeightsChanged(GridRowColSizeChangedEventArgs)

    Raises the RowHeightsChanged event.

    Declaration
    protected virtual void OnRowHeightsChanged(GridRowColSizeChangedEventArgs e)
    Parameters
    Type Name Description
    GridRowColSizeChangedEventArgs e

    A GridRowColSizeChangedEventArgs that contains the event data.

    OnRowHeightsChanging(GridRowColSizeChangingEventArgs)

    Raises the RowHeightsChanging event.

    Declaration
    protected virtual void OnRowHeightsChanging(GridRowColSizeChangingEventArgs e)
    Parameters
    Type Name Description
    GridRowColSizeChangingEventArgs e

    A GridRowColSizeChangingEventArgs that contains the event data.

    OnRowsHidden(GridRowColHiddenEventArgs)

    Raises the RowsHidden event.

    Declaration
    protected virtual void OnRowsHidden(GridRowColHiddenEventArgs e)
    Parameters
    Type Name Description
    GridRowColHiddenEventArgs e

    An GridRowColHiddenEventArgs that contains the event data.

    OnRowsHiding(GridRowColHidingEventArgs)

    Raises the RowsHiding event.

    Declaration
    protected virtual void OnRowsHiding(GridRowColHidingEventArgs e)
    Parameters
    Type Name Description
    GridRowColHidingEventArgs e

    A GridRowColHidingEventArgs that contains the event data.

    OnRowsInserted(GridRangeInsertedEventArgs)

    Raises the RowsInserted event.

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

    A GridRangeInsertedEventArgs that contains the event data.

    OnRowsInserting(GridRangeInsertingEventArgs)

    Raises the RowsInserting event.

    Declaration
    protected virtual void OnRowsInserting(GridRangeInsertingEventArgs e)
    Parameters
    Type Name Description
    GridRangeInsertingEventArgs e

    A GridRangeInsertingEventArgs that contains the event data.

    OnRowsMoved(GridRangeMovedEventArgs)

    Raises the RowsMoved event.

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

    A GridRangeMovedEventArgs that contains the event data.

    OnRowsMoving(GridRangeMovingEventArgs)

    Raises the RowsMoving event.

    Declaration
    protected virtual void OnRowsMoving(GridRangeMovingEventArgs e)
    Parameters
    Type Name Description
    GridRangeMovingEventArgs e

    A GridRangeMovingEventArgs that contains the event data.

    OnRowsRemoved(GridRangeRemovedEventArgs)

    Raises the RowsRemoved event.

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

    A GridRangeRemovedEventArgs that contains the event data.

    OnRowsRemoving(GridRangeRemovingEventArgs)

    Raises the RowsRemoving event.

    Declaration
    protected virtual void OnRowsRemoving(GridRangeRemovingEventArgs e)
    Parameters
    Type Name Description
    GridRangeRemovingEventArgs e

    A GridRangeRemovingEventArgs that contains the event data.

    OnSaveCellFormattedText(GridCellTextEventArgs)

    Raises the SaveCellFormattedText event.

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

    A GridCellTextEventArgs that contains the event data.

    OnSaveCellInfo(GridSaveCellInfoEventArgs)

    Raises the SaveCellInfo event.

    Declaration
    protected virtual void OnSaveCellInfo(GridSaveCellInfoEventArgs e)
    Parameters
    Type Name Description
    GridSaveCellInfoEventArgs e

    A GridSaveCellInfoEventArgs that contains the event data.

    OnSaveCellText(GridCellTextEventArgs)

    Raises the SaveCellText event.

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

    A GridCellTextEventArgs that contains the event data.

    OnSaveColCount(GridRowColCountEventArgs)

    Raises the SaveColCount event.

    Declaration
    protected virtual void OnSaveColCount(GridRowColCountEventArgs e)
    Parameters
    Type Name Description
    GridRowColCountEventArgs e

    A GridRowColCountEventArgs that contains the event data.

    OnSaveColWidth(GridRowColSizeEventArgs)

    Raises the SaveColWidth event.

    Declaration
    protected virtual void OnSaveColWidth(GridRowColSizeEventArgs e)
    Parameters
    Type Name Description
    GridRowColSizeEventArgs e

    A GridRowColSizeEventArgs that contains the event data.

    OnSaveHideCol(GridRowColHideEventArgs)

    Raises the Syncfusion.Windows.Forms.Grid.GridModel.SaveHideCol event.

    Declaration
    protected virtual void OnSaveHideCol(GridRowColHideEventArgs e)
    Parameters
    Type Name Description
    GridRowColHideEventArgs e

    A GridRowColHideEventArgs that contains the event data.

    OnSaveHideRow(GridRowColHideEventArgs)

    Raises the Syncfusion.Windows.Forms.Grid.GridModel.SaveHideRow event.

    Declaration
    protected virtual void OnSaveHideRow(GridRowColHideEventArgs e)
    Parameters
    Type Name Description
    GridRowColHideEventArgs e

    A GridRowColHideEventArgs that contains the event data.

    OnSaveRowCount(GridRowColCountEventArgs)

    Raises the SaveRowCount event.

    Declaration
    protected virtual void OnSaveRowCount(GridRowColCountEventArgs e)
    Parameters
    Type Name Description
    GridRowColCountEventArgs e

    A GridRowColCountEventArgs that contains the event data.

    OnSaveRowHeight(GridRowColSizeEventArgs)

    Raises the SaveRowHeight event.

    Declaration
    protected virtual void OnSaveRowHeight(GridRowColSizeEventArgs e)
    Parameters
    Type Name Description
    GridRowColSizeEventArgs e

    A GridRowColSizeEventArgs that contains the event data.

    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.

    PopulateHeaders(GridRangeInfo, Object)

    Gives you an easy way to copy column headers or names from any given data source that implements the IList interface or is an Array to a specified range of cells in the grid.

    Declaration
    public void PopulateHeaders(GridRangeInfo range, object dataSource)
    Parameters
    Type Name Description
    GridRangeInfo range

    The destination range.

    System.Object dataSource

    A data source that implements the IList interface or is an Array.

    Examples

    This example shows how to populate the headers with the specified range and the data source.

    // Populating DataSource
    DataTable dataTable = new DataTable("Sample");
    dataTable.Columns.Add("Column 1");
    dataTable.Columns.Add("Column 2");
    dataTable.Columns.Add("Column 3");
    dataTable.Columns.Add("Column 4");
    dataTable.Rows.Add("Row1", "Row2", "Row3", "Row4");
    // Populating the headers
    this.gridControl1.PopulateHeaders(GridRangeInfo.Cells(0, 1, 0, 4), dataTable);
    ' Populating DataSource
    Dim dataTable As New DataTable("Sample")
    dataTable.Columns.Add("Column 1")
    dataTable.Columns.Add("Column 2")
    dataTable.Columns.Add("Column 3")
    dataTable.Columns.Add("Column 4")
    dataTable.Rows.Add("Row1", "Row2", "Row3", "Row4")
    ' Populating the headers
    Me.gridControl1.PopulateHeaders(GridRangeInfo.Cells(0, 1, 0, 4), dataTable)
    See Also
    PopulateValues(GridRangeInfo, Object)

    PopulateValues(GridRangeInfo, Object)

    Gives you an easy way to copy data from any given datasource that implements the IList interface or is an Array to a specified range of cells in the grid.

    Declaration
    public void PopulateValues(GridRangeInfo range, object dataSource)
    Parameters
    Type Name Description
    GridRangeInfo range

    The destination range.

    System.Object dataSource

    A data source that implements the IList interface or is an Array.

    Remarks

    PopulateValues uses the low-level SetCellInfo(Int32, Int32, GridStyleInfo, StyleModifyType) method to populate date from the given data source. This makes it a much faster way to fill grid cells instead of using Item[Int32, Int32] or ChangeCells(GridRangeInfo, GridStyleInfo[], StyleModifyType). It will not generate undo information.

    The grid display will be refreshed after the method finishes.

    If you want to fill the grid with large amount of data and give the user a chance to abort the operation, you should assign a DelayedStatusDialog to the model's OperationFeedbackListener.

    Examples

    This example shows how to populate the grid with values for a specified range from the data source.

    // Populating DataSource
    DataTable dataTable = new DataTable("Sample");
    dataTable.Columns.Add("Column 1");
    dataTable.Columns.Add("Column 2");
    dataTable.Columns.Add("Column 3");
    dataTable.Columns.Add("Column 4");
    dataTable.Rows.Add("Row1", "Row2", "Row3", "Row4");
    //Populating the values to grid
    this.gridControl1.PopulateValues(GridRangeInfo.Cells(1, 1, dataTable.Rows.Count, dataTable.Columns.Count), dataTable);
    ' Populating DataSource
    Dim dataTable As New DataTable("Sample")
    dataTable.Columns.Add("Column 1")
    dataTable.Columns.Add("Column 2")
    dataTable.Columns.Add("Column 3")
    dataTable.Columns.Add("Column 4")
    dataTable.Rows.Add("Row1", "Row2", "Row3", "Row4")
    'Populating the values to grid
    Me.gridControl1.PopulateValues(GridRangeInfo.Cells(1, 1, dataTable.Rows.Count, dataTable.Columns.Count), dataTable)
    See Also
    PopulateHeaders(GridRangeInfo, Object)

    PushPrintFloatingCells()

    Temporarily saves the state of floating cells, called from GridPrintDocument.OnBeginPrint before printing.

    Declaration
    public void PushPrintFloatingCells()

    RaiseClearingCells(GridClearingCellsEventArgs)

    Used internally.

    Declaration
    public void RaiseClearingCells(GridClearingCellsEventArgs e)
    Parameters
    Type Name Description
    GridClearingCellsEventArgs e

    RaiseClipboardCanCopy(GridCutPasteEventArgs)

    Used internally.

    Declaration
    public void RaiseClipboardCanCopy(GridCutPasteEventArgs e)
    Parameters
    Type Name Description
    GridCutPasteEventArgs e

    RaiseClipboardCanCut(GridCutPasteEventArgs)

    Used internally.

    Declaration
    public void RaiseClipboardCanCut(GridCutPasteEventArgs e)
    Parameters
    Type Name Description
    GridCutPasteEventArgs e

    RaiseClipboardCanPaste(GridCutPasteEventArgs)

    Used internally.

    Declaration
    public void RaiseClipboardCanPaste(GridCutPasteEventArgs e)
    Parameters
    Type Name Description
    GridCutPasteEventArgs e

    RaiseClipboardCopy(GridCutPasteEventArgs)

    Used internally.

    Declaration
    public void RaiseClipboardCopy(GridCutPasteEventArgs e)
    Parameters
    Type Name Description
    GridCutPasteEventArgs e

    RaiseClipboardCopyToBuffer(ClipboardCopyToBufferEventArgs)

    Used internally.

    Declaration
    public void RaiseClipboardCopyToBuffer(ClipboardCopyToBufferEventArgs e)
    Parameters
    Type Name Description
    ClipboardCopyToBufferEventArgs e

    RaiseClipboardCut(GridCutPasteEventArgs)

    Used internally.

    Declaration
    public void RaiseClipboardCut(GridCutPasteEventArgs e)
    Parameters
    Type Name Description
    GridCutPasteEventArgs e

    RaiseClipboardPaste(GridCutPasteEventArgs)

    Used internally.

    Declaration
    public void RaiseClipboardPaste(GridCutPasteEventArgs e)
    Parameters
    Type Name Description
    GridCutPasteEventArgs e

    RaiseClipboardPasted(GridCutPasteEventArgs)

    Used internally.

    Declaration
    public void RaiseClipboardPasted(GridCutPasteEventArgs e)
    Parameters
    Type Name Description
    GridCutPasteEventArgs e

    RaiseOleDropAtRowCol(GridOleDropAtRowColEventArgs)

    Used internally. initiates calls to OnOleDropAtRowCol(GridOleDropAtRowColEventArgs) method.

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

    An GridOleDropAtRowColEventArgsthat contains the event data.

    RaiseOleDroppedData(EventArgs)

    Used internally. initiates calls to OnOleDroppedData(EventArgs) method.

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

    An System.EventArgsthat contains the event data.

    RaiseParseCommonFormats(GridCellTextEventArgs)

    Used internally.

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

    RaiseQueryCellFormattedText(GridCellTextEventArgs)

    Used internally. Initiates calls to OnQueryCellFormattedText(GridCellTextEventArgs) method.

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

    RaiseQueryCellInfo(GridQueryCellInfoEventArgs)

    Triggers a call to the OnQueryCellInfo(GridQueryCellInfoEventArgs) method which raises QueryCellInfo event.

    Declaration
    public void RaiseQueryCellInfo(GridQueryCellInfoEventArgs e)
    Parameters
    Type Name Description
    GridQueryCellInfoEventArgs e

    Event data.

    RaiseQueryCellModel(GridQueryCellModelEventArgs)

    Used internally.

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

    RaiseQueryCellText(GridCellTextEventArgs)

    Used internally. Initiates calls to OnQueryCellText(GridCellTextEventArgs) method.

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

    RaiseQueryColCount(GridRowColCountEventArgs)

    Triggers a call to the OnQueryColCount(GridRowColCountEventArgs) method which raises QueryColCount event

    Declaration
    public void RaiseQueryColCount(GridRowColCountEventArgs e)
    Parameters
    Type Name Description
    GridRowColCountEventArgs e

    A GridRowColCountEventArgs that contains the event data.

    RaiseQueryDragDropMoveClearCells(CancelEventArgs)

    Used internally.

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

    RaiseQueryMaximumRowCol(Int32, Int32)

    Not implemented yet.

    Declaration
    public void RaiseQueryMaximumRowCol(int nLastRow, int nLastCol)
    Parameters
    Type Name Description
    System.Int32 nLastRow

    The Last row.

    System.Int32 nLastCol

    The Last column.

    RaiseQueryOleDataSourceData(GridQueryOleDataSourceDataEventArgs)

    Used internally.

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

    RaiseQueryRowCount(GridRowColCountEventArgs)

    Triggers a call to the OnQueryRowCount(GridRowColCountEventArgs) method which raises QueryRowCount event

    Declaration
    public void RaiseQueryRowCount(GridRowColCountEventArgs e)
    Parameters
    Type Name Description
    GridRowColCountEventArgs e

    A GridRowColCountEventArgs that contains the event data.

    RaiseSaveCellFormattedText(GridCellTextEventArgs)

    Used internally. Initiates calls to OnSaveCellFormattedText(GridCellTextEventArgs) method.

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

    RaiseSaveCellText(GridCellTextEventArgs)

    Used internally. Initiates calls to OnSaveCellText(GridCellTextEventArgs) method.

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

    RaiseSelectionChanged(GridSelectionChangedEventArgs)

    Used internally.

    Declaration
    public void RaiseSelectionChanged(GridSelectionChangedEventArgs e)
    Parameters
    Type Name Description
    GridSelectionChangedEventArgs e

    RaiseSelectionChanging(GridSelectionChangingEventArgs)

    Used internally.

    Declaration
    public void RaiseSelectionChanging(GridSelectionChangingEventArgs e)
    Parameters
    Type Name Description
    GridSelectionChangingEventArgs e

    Refresh()

    Force all views to be refreshed.

    Declaration
    public virtual void Refresh()

    ResetBanneredRanges()

    Clears all bannered ranges.

    Declaration
    public void ResetBanneredRanges()

    ResetColHiddenEntries()

    Resets values in the HideCols collection.

    Declaration
    public void ResetColHiddenEntries()

    ResetColWidthEntries()

    Resets values in the ColWidths collection.

    Declaration
    public void ResetColWidthEntries()

    ResetCoveredRanges()

    Clears all covered ranges.

    Declaration
    public void ResetCoveredRanges()

    ResetCurrentCellInfo()

    Resets information about position of current cell, current cell renderer, and last active grid control.

    Declaration
    public void ResetCurrentCellInfo()

    ResetGridCells()

    Clears all cell formatting.

    Declaration
    public void ResetGridCells()

    ResetPrintFloatingCells()

    Restores the state of floating cells that has been saved before with PushPrintFloatingCells(). Called from GridPrintDocument.OnEndPrint after printing.

    Declaration
    public void ResetPrintFloatingCells()

    ResetRangeStyles()

    Clears all cell formatting in the GridData object.

    Declaration
    public void ResetRangeStyles()

    ResetRowHeightEntries()

    Resets values in the RowHeights collection.

    Declaration
    public void ResetRowHeightEntries()

    ResetRowHiddenEntries()

    Resets values in the HideRows collection.

    Declaration
    public void ResetRowHiddenEntries()

    ResetVolatileData()

    Resets the volatile data cache. Call this method if you want to refresh the grid and force grid cells that are visible at the moment to reload all their data from data source. Also, the row and column count will be requeried.

    Declaration
    public void ResetVolatileData()

    ResumeChangeEvents()

    Resumes raising change events.

    Declaration
    public void ResumeChangeEvents()

    ResumeRecordUndo()

    Resume logging undo information.

    Declaration
    public void ResumeRecordUndo()

    SaveBinary()

    Saves the current GridModel object to a file in binary format. The filename can be specified with FileName.

    Declaration
    public void SaveBinary()

    SaveBinary(Stream)

    Saves the current GridModel object to a stream in binary format.

    Declaration
    public void SaveBinary(Stream s)
    Parameters
    Type Name Description
    System.IO.Stream s

    Stream object.

    SaveBinary(String)

    Saves the current GridModel object in binary format to a file with the specified filename.

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

    File name.

    SaveSoap()

    Saves the current GridModel object to a file in SOAP format. The filename can be specified with FileName.

    Declaration
    public void SaveSoap()

    SaveSoap(Stream)

    Saves the current GridModel object to a stream in SOAP format.

    Declaration
    public void SaveSoap(Stream s)
    Parameters
    Type Name Description
    System.IO.Stream s

    Stream object.

    SaveSoap(String)

    Saves the current GridModel object in SOAP format to a file with the specified filename.

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

    File name.

    ScrollCellInView(GridRangeInfo, GridScrollCurrentCellReason)

    Scrolls the specifies range into view of the active grid view.

    Declaration
    public void ScrollCellInView(GridRangeInfo range, GridScrollCurrentCellReason reason)
    Parameters
    Type Name Description
    GridRangeInfo range

    The GridRangeInfo to be made visible.

    GridScrollCurrentCellReason reason

    The reason for scrolling the current cell into view (e.g. KeyPress, GridFocus etc.)

    Remarks

    This will only affect the active grid view. See ActiveGridView.

    SetCellInfo(Int32, Int32, GridStyleInfo, StyleModifyType)

    Determines whether changes the cell contents at a specific row and column index.

    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 operation was successful.

    Remarks

    SetCellInfo(Int32, Int32, GridStyleInfo, StyleModifyType) is more low-level than using ChangeCells(GridRangeInfo, GridStyleInfo[], StyleModifyType) or Item[Int32, Int32].

    It provides a faster solution to change cell contents compared to changing cells with ChangeCells(GridRangeInfo, GridStyleInfo[], StyleModifyType) or Item[Int32, Int32]. It will not repaint any cells and also not try to generate undo information.

    SetCellInfo(Int32, Int32, GridStyleInfo, StyleModifyType, Boolean, Boolean)

    Determines whether changes the cell contents at a specific row and column index and allows you to suppress raising SaveCellInfo events and also avoid copying the style objects.

    Declaration
    public bool SetCellInfo(int rowIndex, int colIndex, GridStyleInfo style, StyleModifyType modifyType, bool dontRaiseSaveCellInfoEvent, bool copyReferenceOnly)
    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.

    System.Boolean dontRaiseSaveCellInfoEvent

    If True, the method will not raise the SaveCellInfo event.

    System.Boolean copyReferenceOnly

    If True, the method will try to assign the style object directly. This is only possible if the existing cell was empty before or if modifyType is Copy. Otherwise it will apply the object as specified in modifyType.

    Returns
    Type Description
    System.Boolean

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

    SetCells(GridRangeInfo, GridStyleInfoStoreTable)

    Changes the contents for a range of cells in one batch.

    Declaration
    public void SetCells(GridRangeInfo range, GridStyleInfoStoreTable data)
    Parameters
    Type Name Description
    GridRangeInfo range

    A GridRangeInfo that specifies the range of cells.

    GridStyleInfoStoreTable data

    A GridStyleInfoStoreTable object that holds contents for all the cells.

    See Also
    GetCells(GridRangeInfo)

    SetCells(GridRangeInfo, GridStyleInfoStoreTable, Boolean, Boolean)

    Changes the contents for a range of cells in one batch.

    Declaration
    public void SetCells(GridRangeInfo range, GridStyleInfoStoreTable data, bool dontRaiseSaveCellInfoEvent, bool copyReferenceOnly)
    Parameters
    Type Name Description
    GridRangeInfo range

    A GridRangeInfo that specifies the range of cells.

    GridStyleInfoStoreTable data

    A GridStyleInfoStoreTable object that holds contents for all the cells.

    System.Boolean dontRaiseSaveCellInfoEvent

    If True, the method will not raise the SaveCellInfo event.

    System.Boolean copyReferenceOnly

    If True, the method will try to assign the style object directly. This is only possible if the existing cell was empty before or if modifyType is Copy. Otherwise it will apply the object as specified in modifyType.

    See Also
    GetCells(GridRangeInfo)

    SetColWidthsInt(GridModelRowColSizeIndexer)

    Sets the column widths for grid model. Used internally.

    Declaration
    public void SetColWidthsInt(GridModelRowColSizeIndexer colWidths)
    Parameters
    Type Name Description
    GridModelRowColSizeIndexer colWidths

    SetHideColsInt(GridModelHideRowColsIndexer)

    Used internally.

    Declaration
    public void SetHideColsInt(GridModelHideRowColsIndexer colHidden)
    Parameters
    Type Name Description
    GridModelHideRowColsIndexer colHidden

    SetHideRowsInt(GridModelHideRowColsIndexer)

    Used internally.

    Declaration
    public void SetHideRowsInt(GridModelHideRowColsIndexer rowHidden)
    Parameters
    Type Name Description
    GridModelHideRowColsIndexer rowHidden

    SetRowHeightsInt(GridModelRowColSizeIndexer)

    Sets the row heights,used internally.

    Declaration
    public void SetRowHeightsInt(GridModelRowColSizeIndexer rowHeights)
    Parameters
    Type Name Description
    GridModelRowColSizeIndexer rowHeights

    Row heights of the grid model.

    ShouldSerializeColHiddenEntries()

    Determines if values in the HideCols collection were modified.

    Declaration
    public bool ShouldSerializeColHiddenEntries()
    Returns
    Type Description
    System.Boolean

    True if modified; False otherwise.

    ShouldSerializeColWidthEntries()

    Determines if values in the ColWidths collection were modified.

    Declaration
    public bool ShouldSerializeColWidthEntries()
    Returns
    Type Description
    System.Boolean

    true if modified; false otherwise.

    ShouldSerializeRowHeightEntries()

    Determines if values in the RowHeights collection were modified.

    Declaration
    public bool ShouldSerializeRowHeightEntries()
    Returns
    Type Description
    System.Boolean

    True if modified; False otherwise.

    ShouldSerializeRowHiddenEntries()

    Determines if values in the HideRows collection were modified.

    Declaration
    public bool ShouldSerializeRowHiddenEntries()
    Returns
    Type Description
    System.Boolean

    True if modified; False otherwise.

    StyleInfoBordersToMargins(GridStyleInfo)

    Extracts GridMargins information from a GridStyleInfo.

    Declaration
    public GridMargins StyleInfoBordersToMargins(GridStyleInfo style)
    Parameters
    Type Name Description
    GridStyleInfo style

    The GridStyleInfo object that holds cell information.

    Returns
    Type Description
    GridMargins

    The GridMargins object with border margins.

    SubtractBorders(Rectangle, GridStyleInfo)

    Removes border margins from a given cell rectangle. The borders are determined from a specified style with cell content information.

    Declaration
    [Obsolete("It is recommended to specify isRightToLeft parameter, default for isRightToLeft is False.")]
    public Rectangle SubtractBorders(Rectangle cellBounds, GridStyleInfo style)
    Parameters
    Type Name Description
    System.Drawing.Rectangle cellBounds

    The System.Drawing.Rectangle with the cell bounds.

    GridStyleInfo style

    The GridStyleInfo object that holds cell information.

    Returns
    Type Description
    System.Drawing.Rectangle

    The System.Drawing.Rectangle with the cell bounds excluding its borders.

    SubtractBorders(Rectangle, GridStyleInfo, Boolean)

    Removes border margins from a given cell rectangle. The borders are determined from a specified style with cell content information.

    Declaration
    public Rectangle SubtractBorders(Rectangle cellBounds, GridStyleInfo style, bool isRightToLeft)
    Parameters
    Type Name Description
    System.Drawing.Rectangle cellBounds

    The System.Drawing.Rectangle with the cell bounds.

    GridStyleInfo style

    The GridStyleInfo object that holds cell information.

    System.Boolean isRightToLeft

    Indicates if grid is in RightToLeft mode.

    Returns
    Type Description
    System.Drawing.Rectangle

    The System.Drawing.Rectangle with the cell bounds excluding its borders.

    SuspendChangeEvents()

    Suspends raising change events.

    Declaration
    public void SuspendChangeEvents()

    SuspendRecordUndo()

    Suspend logging undo information.

    Declaration
    public void SuspendRecordUndo()

    SynchronizeCurrentCell(Int32, Int32)

    Calls Syncfusion.Windows.Forms.Grid.GridModel.SetActiveCurrentCell(System.Int32,System.Int32) and raises a Syncfusion.Windows.Forms.Grid.GridModel.SynchronizingCurrentCell event. Good for synchronizing current cell movements in splitter panes.

    Declaration
    public void SynchronizeCurrentCell(int rowIndex, int colIndex)
    Parameters
    Type Name Description
    System.Int32 rowIndex

    The row index.

    System.Int32 colIndex

    The column index.

    Events

    BanneredRangesChanged

    Occurs after bannered range was applied or reset for a range of cells.

    Declaration
    public event GridBanneredRangesChangedEventHandler BanneredRangesChanged
    Event Type
    Type
    GridBanneredRangesChangedEventHandler
    Remarks

    See GridBanneredRangesChangedEventArgs for more detailed discussion about this event.

    BanneredRangesChanging

    Occurs before bannered range is applied or reset for a range of cells.

    Declaration
    public event GridBanneredRangesChangingEventHandler BanneredRangesChanging
    Event Type
    Type
    GridBanneredRangesChangingEventHandler
    Remarks

    See GridBanneredRangesChangingEventArgs for more detailed discussion about this event.

    BaseStylesMapChanged

    Occurs when the reference for BaseStylesMap in GridModel has changed.

    Declaration
    public event EventHandler BaseStylesMapChanged
    Event Type
    Type
    System.EventHandler

    BeginUpdateRequest

    Occurs when the first BeginUpdate was called for the grid model.

    Declaration
    public event EventHandler BeginUpdateRequest
    Event Type
    Type
    System.EventHandler
    Remarks

    See GridRowColSizeEventHandler for more detailed discussion about this event.

    CellModelsChanged

    Occurs when the CellModels collection is changed.

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

    CellsChanged

    Occurs after the contents of a specified range of cells have changed.

    Declaration
    public event GridCellsChangedEventHandler CellsChanged
    Event Type
    Type
    GridCellsChangedEventHandler
    Remarks

    See GridCellsChangedEventArgs for more detailed discussion about this event.

    CellsChanging

    Occurs before the contents of a specified range of cells are being changed.

    Declaration
    public event GridCellsChangingEventHandler CellsChanging
    Event Type
    Type
    GridCellsChangingEventHandler
    Remarks

    See GridRowColSizeEventHandler for more detailed discussion about this event.

    ClearingCells

    Occurs when the ClearCells(GridRangeInfo, Boolean) is called on a GridModel.

    Declaration
    public event GridClearingCellsEventHandler ClearingCells
    Event Type
    Type
    GridClearingCellsEventHandler
    Remarks

    This event lets you provide your own customized clear cells behavior.

    If you do not wish the grid to proceed with default behavior for this method, set Handled to True. The grid will check this flag to see whether it should proceed. If you set it to True, the calling method will return Result as return value.

    If you want the grid to proceed with default behavior, do not change Handled.

    See Also
    GridClearingCellsEventHandler

    ClipboardCanCopy

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

    Declaration
    public event GridCutPasteEventHandler ClipboardCanCopy
    Event Type
    Type
    GridCutPasteEventHandler
    Remarks

    This event lets you provide your own customized paste behavior.

    If you do not wish the grid to proceed with default behavior for this method, set Handled to True. The grid will check this flag to see whether it should proceed. If you set it to True, the calling method will return Result as return value.

    If you want the grid to proceed with default behavior, do not change Handled. You can then specify IgnoreCurrentCell if you want the standard Copy method to ignore the current cell.

    If the user has selected a range of cells and paste is called, you can force the clipboard contents to be pasted into the selected range and not at the current cell's position.

    See Also
    GridCutPasteEventHandler

    ClipboardCanCut

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

    Declaration
    public event GridCutPasteEventHandler ClipboardCanCut
    Event Type
    Type
    GridCutPasteEventHandler
    Remarks

    This event lets you provide your own customized paste behavior.

    If you do not wish the grid to proceed with default behavior for this method, set Handled to True. The grid will check this flag to see whether it should proceed. If you set it to True, the calling method will return Result as return value.

    If you want the grid to proceed with default behavior, do not change Handled. You can specify IgnoreCurrentCell if you want the standard Cut method to ignore the current cell.

    If the user has selected a range of cells and paste is called, you can force the clipboard contents to be pasted into the selected range and not at the current cell's position.

    See Also
    GridCutPasteEventHandler

    ClipboardCanPaste

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

    Declaration
    public event GridCutPasteEventHandler ClipboardCanPaste
    Event Type
    Type
    GridCutPasteEventHandler
    Remarks

    This event lets you provide your own customized paste behavior.

    If you do not wish the grid to proceed with default behavior for this method, set Handled to True. The grid will check this flag to see whether it should proceed. If you set it to True, the calling method will return Result as return value.

    If you want the grid to proceed with default behavior, do not change Handled. You can specify IgnoreCurrentCell if you want the standard Paste method to ignore the current cell.

    If the user has selected a range of cells and paste is called, you can force the clipboard contents to be pasted into the selected range and not at the current cell's position.

    See Also
    GridCutPasteEventHandler

    ClipboardCopy

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

    Declaration
    public event GridCutPasteEventHandler ClipboardCopy
    Event Type
    Type
    GridCutPasteEventHandler
    Remarks

    This event lets you provide your own customized paste behavior.

    If you do not wish the grid to proceed with default behavior for this method, set Handled to True. The grid will check this flag to see whether it should proceed. If you set it to True, the calling method will return Result as return value.

    If you want the grid to proceed with default behavior, do not change Handled. You can then specify IgnoreCurrentCell if you do want the standard Copy method to ignore the current cell.

    If the user has selected a range of cells and paste is called, you can force the clipboard contents to be pasted into the selected range and not at the current cell's position.

    See Also
    GridCutPasteEventHandler

    ClipboardCopyToBuffer

    Occurs when the text copies to buffer

    Declaration
    public event ClipboardCopyToBufferEventHandler ClipboardCopyToBuffer
    Event Type
    Type
    ClipboardCopyToBufferEventHandler
    Remarks

    This event lets you to modify the text which is being copied to the buffer.

    See Also
    ClipboardCopyToBufferEventHandler

    ClipboardCut

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

    Declaration
    public event GridCutPasteEventHandler ClipboardCut
    Event Type
    Type
    GridCutPasteEventHandler
    Remarks

    This event lets you provide your own customized paste behavior.

    If you do not wish the grid to proceed with default behavior for this method, set Handled to True. The grid will check this flag to see whether it should proceed. If you set it to True, the calling method will return Result as return value.

    If you want the grid to proceed with default behavior, do not change Handled. You can then specify IgnoreCurrentCell if you want the standard Cut method to ignore the current cell.

    If the user has selected a range of cells and paste is called, you can force the clipboard contents to be pasted into the selected range and not at the current cell's position.

    See Also
    GridCutPasteEventHandler

    ClipboardPaste

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

    Declaration
    public event GridCutPasteEventHandler ClipboardPaste
    Event Type
    Type
    GridCutPasteEventHandler
    Remarks

    This event lets you provide your own customized paste behavior.

    If you do not wish the grid to proceed with default behavior for this method, set Handled to True. The grid will check this flag to see whether it should proceed. If you set it to True, the calling method will return Result as return value.

    If you want the grid to proceed with default behavior, do not change Handled. You can specify IgnoreCurrentCell if you want the standard Paste to method ignore the current cell.

    If the user has selected a range of cells and paste is called, you can force the clipboard contents to be pasted into the selected range and not at the current cell's position.

    See Also
    GridCutPasteEventHandler

    ClipboardPasted

    Occurs after the Paste() was called on the CutPaste component of a GridModel and text was pasted into the grid.

    Declaration
    public event GridCutPasteEventHandler ClipboardPasted
    Event Type
    Type
    GridCutPasteEventHandler
    Remarks

    This event is called to inform you that text or cells have been pasted.

    See Also
    GridCutPasteEventHandler

    ColsHidden

    Occurs after a range of columns was hidden.

    Declaration
    public event GridRowColHiddenEventHandler ColsHidden
    Event Type
    Type
    GridRowColHiddenEventHandler
    Remarks

    See GridRowColHidingEventArgs for more detailed discussion about this event.

    ColsHiding

    Occurs before a range of columns is hidden.

    Declaration
    public event GridRowColHidingEventHandler ColsHiding
    Event Type
    Type
    GridRowColHidingEventHandler
    Remarks

    See GridRowColHidingEventArgs for more detailed discussion about this event.

    ColsInserted

    Occurs after a range of columns has been inserted.

    Declaration
    public event GridRangeInsertedEventHandler ColsInserted
    Event Type
    Type
    GridRangeInsertedEventHandler
    Remarks

    See GridRangeInsertedEventArgs for more detailed discussion about this event.

    ColsInserting

    Occurs before a range of columns is inserted.

    Declaration
    public event GridRangeInsertingEventHandler ColsInserting
    Event Type
    Type
    GridRangeInsertingEventHandler
    Remarks

    See GridRangeInsertingEventArgs for more detailed discussion about this event.

    ColsMoved

    Occurs after a range of columns is moved.

    Declaration
    public event GridRangeMovedEventHandler ColsMoved
    Event Type
    Type
    GridRangeMovedEventHandler
    Remarks

    See GridRangeMovedEventArgs for more detailed discussion about this event.

    ColsMoving

    Occurs before a range of columns is moved.

    Declaration
    public event GridRangeMovingEventHandler ColsMoving
    Event Type
    Type
    GridRangeMovingEventHandler
    Remarks

    See GridRangeMovingEventArgs for more detailed discussion about this event.

    ColsRemoved

    Occurs after a range of columns has been inserted.

    Declaration
    public event GridRangeRemovedEventHandler ColsRemoved
    Event Type
    Type
    GridRangeRemovedEventHandler
    Remarks

    See GridRangeRemovedEventArgs for more detailed discussion about this event.

    ColsRemoving

    Occurs before a range of columns is removed.

    Declaration
    public event GridRangeRemovingEventHandler ColsRemoving
    Event Type
    Type
    GridRangeRemovingEventHandler
    Remarks

    See GridRangeRemovingEventArgs for more detailed discussion about this event.

    ColWidthsChanged

    Occurs after column widths for a specified range of columns have been changed.

    Declaration
    public event GridRowColSizeChangedEventHandler ColWidthsChanged
    Event Type
    Type
    GridRowColSizeChangedEventHandler
    Remarks

    See GridRowColSizeChangedEventArgs for more detailed discussion about this event.

    ColWidthsChanging

    Occurs before column widths for a specified range of columns are changed.

    Declaration
    public event GridRowColSizeChangingEventHandler ColWidthsChanging
    Event Type
    Type
    GridRowColSizeChangingEventHandler
    Remarks

    See GridRowColSizeEventHandler for more detailed discussion about this event.

    CommandStackChanged

    Occurs when an undo or redo command has been added to the command stack. Check GridModelCommandManager.UndoStack or GridModelCommandManager.RedoStack to see the list of commands on the stack.

    Declaration
    public event EventHandler CommandStackChanged
    Event Type
    Type
    System.EventHandler

    ConfirmingPendingChanges

    Occurs when any changes in the grid should be confirmed.

    Declaration
    public event CancelEventHandler ConfirmingPendingChanges
    Event Type
    Type
    System.ComponentModel.CancelEventHandler
    Remarks

    This event is raised as a result of a ConfirmPendingChanges() method call.

    Set System.ComponentModel.CancelEventArgs.Cancel True if you cannot commit pending changes.

    CoveredRangesChanged

    Occurs after covering was applied or reset for a range of cells.

    Declaration
    public event GridCoveredRangesChangedEventHandler CoveredRangesChanged
    Event Type
    Type
    GridCoveredRangesChangedEventHandler
    Remarks

    See GridCoveredRangesChangedEventArgs for more detailed discussion about this event.

    CoveredRangesChanging

    Occurs before covering is applied or reset for a range of cells.

    Declaration
    public event GridCoveredRangesChangingEventHandler CoveredRangesChanging
    Event Type
    Type
    GridCoveredRangesChangingEventHandler
    Remarks

    See GridCoveredRangesChangingEventArgs for more detailed discussion about this event.

    DataChanged

    Occurs when Data has changed.

    Declaration
    public event EventHandler DataChanged
    Event Type
    Type
    System.EventHandler

    DataProviderChanged

    Occurs when the DataProvider property has changed.

    Declaration
    public event EventHandler DataProviderChanged
    Event Type
    Type
    System.EventHandler

    DataProviderQueryCellInfo

    Occurs when the model queries for style information about a specific cell and a DataProvider (e.g. GridModelDataBinder) has been specified.

    Declaration
    public event GridQueryCellInfoEventHandler DataProviderQueryCellInfo
    Event Type
    Type
    GridQueryCellInfoEventHandler
    Remarks

    This event allows you to customize cell contents at run-time on demand, just before the QueryCellInfo(GridQueryCellInfoEventArgs) of the DataProvider is called.

    If you make changes to Style you should also set Handled to True. The grid will check this flag to see whether the style has been initialized. If the event has been marked as handled, the grid will not access cell information from its own data store or from DataProvider. In the default case when the event is not marked as handled, the grid will locate cell information by calling QueryCellInfo(GridQueryCellInfoEventArgs) and Item[Int32, Int32].

    See and QueryCellInfo(GridQueryCellInfoEventArgs) for further discussion about this event.

    See Also
    GridQueryCellInfoEventArgs
    SaveCellInfo
    IGridModelDataProvider
    GridModelDataBinder
    GridSaveCellInfoEventArgs

    DataProviderSaveCellInfo

    Occurs when the model is about to save style information about a specific cell and a DataProvider (e.g. GridModelDataBinder) has been specified.

    Declaration
    public event GridSaveCellInfoEventHandler DataProviderSaveCellInfo
    Event Type
    Type
    GridSaveCellInfoEventHandler
    Remarks

    This is similar to the SaveCellInfo event.

    Is called before GridModelDataBinder.SaveCellInfo is called and gives you a chance to modify style data before they are saved in underlying data source.

    If you made changes to Style, you should also set Handled to True. The grid will check this flag to see whether the style has been changed from its original settings.

    note

    The intention of this event is to store data. See GridCellsChangedEventArgs for the related UI event after changes were made to the data store.

    See GridSaveCellInfoEventArgs and SaveCellInfo(GridSaveCellInfoEventArgs) for further discussion about this event.

    See Also
    GridSaveCellInfoEventArgs
    SaveCellInfo
    IGridModelDataProvider
    GridModelDataBinder
    GridSaveCellInfoEventArgs

    DefaultColWidthChanged

    Occurs after the default column width has been changed.

    Declaration
    public event GridDefaultSizeChangedEventHandler DefaultColWidthChanged
    Event Type
    Type
    GridDefaultSizeChangedEventHandler
    Remarks

    See GridDefaultSizeChangedEventArgs for more detailed discussion about this event.

    DefaultColWidthChanging

    Occurs before the default column width is changed.

    Declaration
    public event GridDefaultSizeChangingEventHandler DefaultColWidthChanging
    Event Type
    Type
    GridDefaultSizeChangingEventHandler
    Remarks

    See GridDefaultSizeChangingEventArgs for more detailed discussion about this event.

    DefaultRowHeightChanged

    Occurs after the default row height has been changed.

    Declaration
    public event GridDefaultSizeChangedEventHandler DefaultRowHeightChanged
    Event Type
    Type
    GridDefaultSizeChangedEventHandler
    Remarks

    See GridDefaultSizeChangedEventArgs for more detailed discussion about this event.

    DefaultRowHeightChanging

    Occurs before the default row height is changed.

    Declaration
    public event GridDefaultSizeChangingEventHandler DefaultRowHeightChanging
    Event Type
    Type
    GridDefaultSizeChangingEventHandler
    Remarks

    See GridDefaultSizeChangingEventArgs for more detailed discussion about this event.

    EndUpdateRequest

    Occurs when EndUpdate was called for the grid model.

    Declaration
    public event GridEndUpdateRequestEventHandler EndUpdateRequest
    Event Type
    Type
    GridEndUpdateRequestEventHandler
    Remarks

    See GridEndUpdateRequestEventArgs for more detailed discussion about this event.

    FileNameChanged

    Occurs when FileName has changed.

    Declaration
    public event EventHandler FileNameChanged
    Event Type
    Type
    System.EventHandler

    FloatingCellsChanged

    Occurs after floating state was changed for a range of cells.

    Declaration
    public event GridFloatingCellsChangedEventHandler FloatingCellsChanged
    Event Type
    Type
    GridFloatingCellsChangedEventHandler
    Remarks

    See GridFloatingCellsChangedEventArgs for more detailed discussion about this event.

    FrozenColCountChanged

    Occurs after the frozen column count has been changed.

    Declaration
    public event GridCountChangedEventHandler FrozenColCountChanged
    Event Type
    Type
    GridCountChangedEventHandler
    Remarks

    See GridCountChangedEventArgs for more detailed discussion about this event.

    FrozenColCountChanging

    Occurs before the frozen column count is changed.

    Declaration
    public event GridCountChangingEventHandler FrozenColCountChanging
    Event Type
    Type
    GridCountChangingEventHandler
    Remarks

    See GridCountChangingEventArgs for more detailed discussion about this event.

    FrozenRowCountChanged

    Occurs after the frozen row count has been changed.

    Declaration
    public event GridCountChangedEventHandler FrozenRowCountChanged
    Event Type
    Type
    GridCountChangedEventHandler
    Remarks

    See GridCountChangedEventArgs for more detailed discussion about this event.

    FrozenRowCountChanging

    Occurs before the frozen row count is changed.

    Declaration
    public event GridCountChangingEventHandler FrozenRowCountChanging
    Event Type
    Type
    GridCountChangingEventHandler
    Remarks

    See GridCountChangingEventArgs for more detailed discussion about this event.

    HeaderColCountChanged

    Occurs after the header column count has been changed.

    Declaration
    public event GridCountChangedEventHandler HeaderColCountChanged
    Event Type
    Type
    GridCountChangedEventHandler
    Remarks

    See GridCountChangedEventArgs for more detailed discussion about this event.

    HeaderColCountChanging

    Occurs before the header column count is changed.

    Declaration
    public event GridCountChangingEventHandler HeaderColCountChanging
    Event Type
    Type
    GridCountChangingEventHandler
    Remarks

    See GridCountChangingEventArgs for more detailed discussion about this event.

    HeaderRowCountChanged

    Occurs after the header row count has been changed.

    Declaration
    public event GridCountChangedEventHandler HeaderRowCountChanged
    Event Type
    Type
    GridCountChangedEventHandler
    Remarks

    See GridCountChangedEventArgs for more detailed discussion about this event.

    HeaderRowCountChanging

    Occurs before the header row count is changed.

    Declaration
    public event GridCountChangingEventHandler HeaderRowCountChanging
    Event Type
    Type
    GridCountChangingEventHandler
    Remarks

    See GridCountChangingEventArgs for more detailed discussion about this event.

    InvalidateRangeRequest

    Occurs when InvalidateRange(GridRangeInfo, GridRangeOptions) is called for the GridModel.

    Declaration
    public event GridInvalidateRangeRequestEventHandler InvalidateRangeRequest
    Event Type
    Type
    GridInvalidateRangeRequestEventHandler

    MergeCellsChanged

    Occurs after merge state was changed for a range of cells.

    Declaration
    public event GridMergeCellsChangedEventHandler MergeCellsChanged
    Event Type
    Type
    GridMergeCellsChangedEventHandler
    Remarks

    See GridMergeCellsChangedEventArgs for more detailed discussion about this event.

    ModifiedChanged

    Occurs when Modified has changed.

    Declaration
    public event EventHandler ModifiedChanged
    Event Type
    Type
    System.EventHandler

    OleDropAtRowCol

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

    Declaration
    public event GridOleDropAtRowColEventHandler OleDropAtRowCol
    Event Type
    Type
    GridOleDropAtRowColEventHandler
    Remarks

    This event lets you provide your own customized paste data behavior.

    If you do not wish the grid to proceed with default behavior for this method, set Handled to True. The grid will check this flag to see whether it should proceed. If you set it to True, the calling method will check Result as indication if the operation was successful.

    If you want the grid to proceed with default behavior, do not change Handled.

    See Also
    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

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

    This event is raised from GridCellModelBase.ApplyFormattedText after SaveCellFormattedText was raised. The event is raised only if the SaveCellFormattedText did not set e.Handled.

    Declaration
    public event GridCellTextEventHandler ParseCommonFormats
    Event Type
    Type
    GridCellTextEventHandler
    Remarks

    The grid has built-in support for parsing the Percent format (Format = "P") and Hexadecimal format (Format = "X"). You should handle this event if you want to add support for other formats.

    GridCellTextEventArgs has information about the style settings of the cell. You can inspect that style to get information about Format and CellValueType of the cell.

    PasteCellText

    Occurs for each cell when text is pasted from a buffer into several cells.

    Declaration
    public event GridPasteCellTextEventHandler PasteCellText
    Event Type
    Type
    GridPasteCellTextEventHandler
    Remarks

    This event allows you to customize how to handle text pasted into a cell at run-time on demand.

    If you do not wish the grid to make any changes to the cell, set System.Windows.Form.CancelEventArgs.Cancel to True. The grid will check this flag to see whether it should make changes to the cell.

    If you do wish the grid to abort the current paste operation (in case several cells are pasted), set the Abort flag to True.

    The GridPasteCellTextEventArgs members, e.ColIndex and e.RowIndex, specify column and row of the cell. The e.Style member holds the GridStyleInfo object for the cell.

    See Also
    GridPasteCellTextEventHandler
    GridPasteCellTextEventArgs
    PasteCellText

    PrepareChangeSelection

    Occurs before the model changes the current selection.

    Declaration
    public event GridPrepareChangeSelectionEventHandler PrepareChangeSelection
    Event Type
    Type
    GridPrepareChangeSelectionEventHandler
    Remarks

    This event is raised by the model to notify all associated views that there has been a change to the current selection in the grid and all associated views should redraw affected display contents. The change can be originated by a mouse or keyboard input or programmatically.

    See GridPrepareChangeSelectionEventArgs for further discussion about this event.

    PrepareClearSelection

    Occurs before the grid model will clear its list of selected ranges when the user selects a new range of cells or when Clear() was called.

    Declaration
    public event EventHandler PrepareClearSelection
    Event Type
    Type
    System.EventHandler
    Remarks

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

    PrepareGraphics

    Occurs before the grid draws to or uses a System.Drawing.Graphics context.

    Declaration
    public event GraphicsEventHandler PrepareGraphics
    Event Type
    Type
    GraphicsEventHandler
    Remarks

    Typical places where this event is raised are: OnPaint(PaintEventArgs) of the GridControlBase and ResizeToFit(GridRangeInfo).

    Raises a PrepareGraphics event.

    QueryBanneredRange

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

    Declaration
    public event GridQueryBanneredRangeEventHandler QueryBanneredRange
    Event Type
    Type
    GridQueryBanneredRangeEventHandler
    Remarks

    This event allows you to specify bannered ranges at run-time, e.g when you have a large grid with repeating patterns of bannered ranges. If the specified row and column index is part of a bannered cells range you should assign the coordinates of the bannered cell to Range and set Handled to True.

    Handled indicates that you supplied data from your event handler and no further querying for data about bannered range information for this cell is necessary.

    See the BannerCells sample for an example how to use this event.

    See Also
    GridQueryBanneredRangeEventHandler

    QueryCanMergeCells

    Occurs when grid compares the contents of two cells to determine if they should be merged. Set Handled to True if you want to provide a customized comparison for cell contents.

    Declaration
    public event GridQueryCanMergeCellsEventHandler QueryCanMergeCells
    Event Type
    Type
    GridQueryCanMergeCellsEventHandler

    QueryCellFormattedText

    Occurs each time the FormattedText is called to get the formatted string that represents the underlying cell's value considering Format.

    Declaration
    public event GridCellTextEventHandler QueryCellFormattedText
    Event Type
    Type
    GridCellTextEventHandler
    Remarks

    This event allows you to customize how to format a cell's value as string at run-time on demand based on Format.

    If you do want to customize the grid's default formatting, you should assign the resulting string to Text and set Handled to True. The grid will check this flag to see whether it should return Text or use a default formatting routine.

    If you need identity information about the cell such as row and column index, you can get that information by querying the CellIdentity of the Style object.

    See Also
    GridCellTextEventHandler
    GridCellTextEventArgs
    SaveCellFormattedText
    QueryCellFormattedText
    ApplyFormattedText(GridStyleInfo, System.String, System.Int32)
    FormattedText

    QueryCellInfo

    Occurs when the model queries for style information about a specific cell.

    Declaration
    public event GridQueryCellInfoEventHandler QueryCellInfo
    Event Type
    Type
    GridQueryCellInfoEventHandler
    Remarks

    This event allows you to customize cell contents at run-time on demand, just before the cell is drawn or programmatically accessed through Item[Int32, Int32], ColStyles, RowStyles, or TableStyle.

    If you made changes to Style you should also set Handled to true. The grid will check this flag to see whether the style has been initialized. If the event has been marked as handled, the grid will not access cell information from its own data store Data. In the default case when the event is not marked as handled, the grid will locate cell information by calling Item[Int32, Int32].

    See GridQueryCellInfoEventArgs for further discussion about this event.

    See Also
    GridQueryCellInfoEventArgs
    SaveCellInfo
    IGridModelDataProvider
    GridSaveCellInfoEventArgs

    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

    QueryCellText

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

    Declaration
    public event GridCellTextEventHandler QueryCellText
    Event Type
    Type
    GridCellTextEventHandler
    Remarks

    This event allows you to customize how to represent a cell's value as string at run-time on demand.

    If you do want to customize the grid's default conversion, you should assign the result string to Text and set Handled to True. The grid will check this flag to see whether it should return Text or use a default conversion.

    If you need identity information about the cell such as row and column index, you can get that information by querying CellIdentity of the Style object.

    See Also
    GridCellTextEventHandler
    GridCellTextEventArgs
    SaveCellText
    QueryCellText
    GetText(GridStyleInfo, System.Object)
    Text

    QueryColCount

    Occurs before the column count is returned from the model.

    Declaration
    public event GridRowColCountEventHandler QueryColCount
    Event Type
    Type
    GridRowColCountEventHandler
    Remarks

    See GridRowColCountEventArgs for a more detailed discussion.

    QueryColWidth

    Occurs before the size of a column is returned from the dictionary.

    Declaration
    public event GridRowColSizeEventHandler QueryColWidth
    Event Type
    Type
    GridRowColSizeEventHandler
    Remarks

    See GridRowColSizeEventHandler for more detailed discussion about this event.

    QueryCoveredRange

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

    Declaration
    public event GridQueryCoveredRangeEventHandler QueryCoveredRange
    Event Type
    Type
    GridQueryCoveredRangeEventHandler
    Remarks

    This event allows you to specify covered ranges at run-time, e.g when you have a large grid with repeating patterns of covered ranges. If the specified row and column index is part of a covered cells range, you should assign the coordinates of the covered cell to Range and set Handled to True.

    Handled indicates that you supplied data from your event handler and no further querying for data about covered range information for this cell is necessary.

    See the VirtualGrid sample for an example how to use this event.

    See Also
    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

    Occurs when a user starts dragging a range of selected cells using OLE drag-and-drop.

    Declaration
    public event GridQueryOleDataSourceDataEventHandler QueryOleDataSourceData
    Event Type
    Type
    GridQueryOleDataSourceDataEventHandler
    Remarks

    This event lets you supply your own clipboard formats or add support for pasting additional clipboard content.

    If you do not wish the grid to proceed with default behavior for this method, set Handled to True. The grid will check this flag to see whether it should proceed. If you set it to True, the calling method will return Result as return value.

    If you want the grid to proceed with default behavior, do not change Handled. You can specify IgnoreCurrentCell if you want the standard Copy method to ignore the current cell or change DragDropFlags for more advanced options.

    This event lets you customize the OLE Data Source behavior of an OLE drag-and-drop operation. See the IGridDataObjectConsumer interface for customizing the OLE DropTarget part of an OLE drag-and-drop operation.

    See Also
    GridQueryOleDataSourceDataEventHandler

    QueryRowCount

    Occurs before the row count is returned from the model.

    Declaration
    public event GridRowColCountEventHandler QueryRowCount
    Event Type
    Type
    GridRowColCountEventHandler
    Remarks

    See GridRowColCountEventArgs for a more detailed discussion.

    QueryRowHeight

    Occurs when the size of a row is retrieved.

    Declaration
    public event GridRowColSizeEventHandler QueryRowHeight
    Event Type
    Type
    GridRowColSizeEventHandler
    Remarks

    See GridRowColSizeEventHandler for more detailed discussion about this event.

    QueryRowHeightTotal

    Occurs when the total size of several rows is retrieved.

    Declaration
    public event GridRowColSizeTotalEventHandler QueryRowHeightTotal
    Event Type
    Type
    GridRowColSizeTotalEventHandler
    Remarks

    See GridRowColSizeEventHandler for more detailed discussion about this event.

    ReadOnlyChanged

    Occurs when ReadOnly has changed.

    Declaration
    public event EventHandler ReadOnlyChanged
    Event Type
    Type
    System.EventHandler

    RefreshRequest

    Occurs when Refresh is called.

    Declaration
    public event EventHandler RefreshRequest
    Event Type
    Type
    System.EventHandler
    Remarks

    See Refresh() for more detailed discussion about this event.

    RowHeightsChanged

    Occurs after row heights for a specified range of rows have been changed.

    Declaration
    public event GridRowColSizeChangedEventHandler RowHeightsChanged
    Event Type
    Type
    GridRowColSizeChangedEventHandler
    Remarks

    See GridRowColSizeChangedEventArgs for more detailed discussion about this event.

    RowHeightsChanging

    Occurs before row heights for a specified range of rows are changed.

    Declaration
    public event GridRowColSizeChangingEventHandler RowHeightsChanging
    Event Type
    Type
    GridRowColSizeChangingEventHandler
    Remarks

    See GridRowColSizeChangingEventArgs for more detailed discussion about this event.

    RowsHidden

    Occurs after a range of rows was hidden.

    Declaration
    public event GridRowColHiddenEventHandler RowsHidden
    Event Type
    Type
    GridRowColHiddenEventHandler
    Remarks

    See GridRowColHidingEventArgs for more detailed discussion about this event.

    RowsHiding

    Occurs before a range of rows is hidden.

    Declaration
    public event GridRowColHidingEventHandler RowsHiding
    Event Type
    Type
    GridRowColHidingEventHandler
    Remarks

    See GridRowColHidingEventArgs for more detailed discussion about this event.

    RowsInserted

    Occurs after a range of rows has been inserted.

    Declaration
    public event GridRangeInsertedEventHandler RowsInserted
    Event Type
    Type
    GridRangeInsertedEventHandler
    Remarks

    See GridRangeInsertedEventArgs for more detailed discussion about this event.

    RowsInserting

    Occurs before a range of rows is inserted.

    Declaration
    public event GridRangeInsertingEventHandler RowsInserting
    Event Type
    Type
    GridRangeInsertingEventHandler
    Remarks

    See GridRangeInsertingEventArgs for more detailed discussion about this event.

    RowsMoved

    Occurs after a range of rows is moved.

    Declaration
    public event GridRangeMovedEventHandler RowsMoved
    Event Type
    Type
    GridRangeMovedEventHandler
    Remarks

    See GridRangeMovedEventArgs for more detailed discussion about this event.

    RowsMoving

    Occurs before a range of rows is moved.

    Declaration
    public event GridRangeMovingEventHandler RowsMoving
    Event Type
    Type
    GridRangeMovingEventHandler
    Remarks

    See GridRangeMovingEventArgs for more detailed discussion about this event.

    RowsRemoved

    Occurs after a range of rows has been removed.

    Declaration
    public event GridRangeRemovedEventHandler RowsRemoved
    Event Type
    Type
    GridRangeRemovedEventHandler
    Remarks

    See GridRangeRemovedEventArgs for more detailed discussion about this event.

    RowsRemoving

    Occurs before a range of rows is removed.

    Declaration
    public event GridRangeRemovingEventHandler RowsRemoving
    Event Type
    Type
    GridRangeRemovingEventHandler
    Remarks

    See GridRangeRemovingEventArgs for more detailed discussion about this event.

    SaveCellFormattedText

    Occurs each time the FormattedText is called to parse the formatted string that represents the underlying cell's value considering Format and CellValueType.

    Declaration
    public event GridCellTextEventHandler SaveCellFormattedText
    Event Type
    Type
    GridCellTextEventHandler
    Remarks

    This event allows you to customize how to parse the formatted text into a cell value at run-time on demand.

    If you do want to customize the grid's default parsing behavior, you should assign the resulting value to the CellValue of the GridStyleInfo object and set Handled to True. The grid will check this flag to see whether it should accept your modification or use a default parsing routine.

    If you need identity information about the cell such as row and column index, you can get that information by querying the CellIdentity of the Style object.

    This event is normally called from within ApplyFormattedText(String), which is called when the user enters text into a text box or when text is assigned to FormattedText. ApplyFormattedText method checks if there are event handlers for SaveCellFormattedText and if the Handled is not set, they try to convert the input text into the type specified with CellValueType.

    If this conversion fails, ApplyFormattedText(String) will check StrictValueType. If it is True, an exception is thrown which itself results in a warning message displayed to the user at the time from CurrentCellValidating.

    If you set StrictValueType to False, ApplyFormattedText(String) will not throw an exception and simply store the text as CellValue.

    If you need a more specialized customization of this behavior, you should handle the SaveCellFormattedText event. This lets you parse the text input and change the cells CellValueType at run-time. See the attached example.

    Examples

    This example parses the text input and changes the cell's CellValueType at run-time if the input does not match the current CellValueType.

    void InitializeComponent()
    {
        // initialize code
        // ...
        this.gridControl1.SaveCellText += new Syncfusion.Windows.Forms.Grid.GridCellTextEventHandler(this.gridControl1_SaveCellText);
        this.gridControl1.QueryCellFormattedText += new Syncfusion.Windows.Forms.Grid.GridCellTextEventHandler(this.gridControl1_QueryCellFormattedText);
        this.gridControl1.SaveCellFormattedText += new Syncfusion.Windows.Forms.Grid.GridCellTextEventHandler(this.gridControl1_SaveCellFormattedText);
        this.gridControl1.QueryCellText += new Syncfusion.Windows.Forms.Grid.GridCellTextEventHandler(this.gridControl1_QueryCellText);
    }
    

    private void gridControl1_QueryCellFormattedText(object sender, Syncfusion.Windows.Forms.Grid.GridCellTextEventArgs e) {

    }

    private void gridControl1_QueryCellText(object sender, Syncfusion.Windows.Forms.Grid.GridCellTextEventArgs e) {

    }

    private void gridControl1_SaveCellText(object sender, Syncfusion.Windows.Forms.Grid.GridCellTextEventArgs e) { ParseText(e); }

    private void gridControl1_SaveCellFormattedText(object sender, GridCellTextEventArgs e) { ParseText(e); }

    void ParseText(GridCellTextEventArgs e) { // By default, the grid will display a warning message box informing the user // the entered value is not valid and the user will have to change the value. // // In this event handler, we change the grid default's behavior such that // when the user enters a value that does not fit the cell's CellValueType, // the input text is accepted and no warning message is shown. if (e.Handled) return;

    System.Globalization.CultureInfo ci = e.Style.CultureInfo; System.Globalization.NumberFormatInfo nfi = ci != null ? ci.NumberFormat : null; try { e.Style.CellValue = GridCellValueConvert.Parse(e.Text, e.Style.CellValueType, nfi, e.Style.Format); } catch (Exception ex) { if (ex is FormatException || ex.InnerException is FormatException) { e.Style.CellValue = e.Text; // possibly could also change CellValueType here e.Style.CellValueType = typeof(string); // - or - // you could also further analyze the input text and assign a type // that fits the input text, e.g. // e.Style.CellValueType = typeof(datetime); // - or - // e.Style.CellValueType = typeof(decimal); // etc. } else throw; } e.Handled = true; }

    Private Sub InitializeComponent()
        ' Initalize code
        ' ...
        AddHandler Me.gridControl1.SaveCellText, AddressOf Me.gridControl1_SaveCellText
        AddHandler Me.gridControl1.QueryCellFormattedText, AddressOf Me.gridControl1_QueryCellFormattedText
        AddHandler Me.gridControl1.SaveCellFormattedText, AddressOf Me.gridControl1_SaveCellFormattedText
        AddHandler Me.gridControl1.QueryCellText, AddressOf Me.gridControl1_QueryCellText
    End Sub 'InitializeComponent
    

    Private Sub gridControl1_QueryCellFormattedText(sender As Object, e As Syncfusion.Windows.Forms.Grid.GridCellTextEventArgs) End Sub 'gridControl1_QueryCellFormattedText

    Private Sub gridControl1_QueryCellText(sender As Object, e As Syncfusion.Windows.Forms.Grid.GridCellTextEventArgs) End Sub 'gridControl1_QueryCellText

    Private Sub gridControl1_SaveCellText(sender As Object, e As Syncfusion.Windows.Forms.Grid.GridCellTextEventArgs) ParseText(e) End Sub 'gridControl1_SaveCellText

    Private Sub gridControl1_SaveCellFormattedText(sender As Object, e As GridCellTextEventArgs) ParseText(e) End Sub 'gridControl1_SaveCellFormattedText

    Sub ParseText(e As GridCellTextEventArgs) ' By default, the grid will display a warning message box informing the user ' the entered value is not valid and the user will have to change the value. ' ' In this event handler we change the grid default's behavior such that ' when the user enters a value that does not fit the cell's CellValueType, ' the input text is accepted and no warning message is shown. If e.Handled Then Return End If Dim ci As System.Globalization.CultureInfo = e.Style.CultureInfo Dim nfi As System.Globalization.NumberFormatInfo = Nothing If (Not (ci Is Nothing)) Then nfi = ci.NumberFormat Try e.Style.CellValue = GridCellValueConvert.Parse(e.Text, e.Style.CellValueType, nfi, e.Style.Format) Catch ex As Exception If TypeOf ex Is FormatException OrElse TypeOf ex.InnerException Is FormatException Then e.Style.CellValue = e.Text ' possibly could also change CellValueType here ' e.Style.CellValueType = typeof(string); ' - or - ' you could also further analyze the input text and assign a type ' that fits the input text, e.g. ' e.Style.CellValueType = typeof(datetime); ' - or - ' e.Style.CellValueType = typeof(decimal); ' etc. Else Throw End If End Try e.Handled = True End Sub 'ParseText

    See Also
    GridCellTextEventHandler
    GridCellTextEventArgs
    SaveCellFormattedText
    QueryCellFormattedText
    ApplyFormattedText(GridStyleInfo, System.String, System.Int32)
    FormattedText
    CellValueType
    StrictValueType

    SaveCellInfo

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

    Declaration
    public event GridSaveCellInfoEventHandler SaveCellInfo
    Event Type
    Type
    GridSaveCellInfoEventHandler
    Remarks

    If you made changes to Style you should also set Handled to True. The grid will check this flag to see whether the style has been changed from its original settings.

    See DataBoundGrid source code for example.

    note

    The intention of this event is to store data. See GridCellsChangedEventArgs for the related UI event after changes were made to the data store.

    See for further discussion about this event.

    See Also
    GridSaveCellInfoEventHandler
    SaveCellInfo
    IGridModelDataProvider
    GridQueryCellInfoEventArgs

    SaveCellText

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

    Declaration
    public event GridCellTextEventHandler SaveCellText
    Event Type
    Type
    GridCellTextEventHandler
    Remarks

    This event allows you to customize how to parse the unformatted text into a cell value at run-time on demand.

    If you do want to customize the grid's default parsing behavior, you should assign the resulting value to the CellValue of the GridStyleInfo object and set Handled to True. The grid will check this flag to see whether it should accept your modification or use a default parsing routine.

    If you need identity information about the cell such as row and column index, query the CellIdentity of the Style object.

    See the SaveCellFormattedText event for further discussion since these two events are very similar. Often you will need to handle both events in your code in the same way.

    See Also
    GridCellTextEventHandler
    GridCellTextEventArgs
    SaveCellText
    QueryCellText
    ApplyText(GridStyleInfo, System.String)
    Text

    SaveColCount

    Occurs before the column count is changed in the model.

    Declaration
    public event GridRowColCountEventHandler SaveColCount
    Event Type
    Type
    GridRowColCountEventHandler
    Remarks

    See GridRowColCountEventArgs for a more detailed discussion.

    SaveColWidth

    Occurs before the size of a column is stored in the dictionary.

    Declaration
    public event GridRowColSizeEventHandler SaveColWidth
    Event Type
    Type
    GridRowColSizeEventHandler
    Remarks

    See GridRowColSizeEventHandler for more detailed discussion about this event.

    SaveRowCount

    Occurs before the row count is changed in the model.

    Declaration
    public event GridRowColCountEventHandler SaveRowCount
    Event Type
    Type
    GridRowColCountEventHandler
    Remarks

    See GridRowColCountEventArgs for a more detailed discussion.

    SaveRowHeight

    Occurs before the size of a row is stored in the dictionary.

    Declaration
    public event GridRowColSizeEventHandler SaveRowHeight
    Event Type
    Type
    GridRowColSizeEventHandler
    Remarks

    See GridRowColSizeEventHandler for more detailed discussion about this event.

    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

    IGridModelSource.Model

    Gets a reference to a GridModel.

    Declaration
    GridModel IGridModelSource.Model { get; }
    Returns
    Type
    GridModel

    IDeserializationCallback.OnDeserialization(Object)

    Runs when the entire object graph has been de-serialized.

    Declaration
    void IDeserializationCallback.OnDeserialization(object sender)
    Parameters
    Type Name Description
    System.Object sender

    The source of the method.

    ISerializable.GetObjectData(SerializationInfo, StreamingContext)

    Implements the ISerializable interface and returns the data needed to serialize the GridModel.

    Declaration
    void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info

    A SerializationInfo object containing the information required to serialize the object.

    System.Runtime.Serialization.StreamingContext context

    A StreamingContext object containing the source and destination of the serialized stream.

    Implements

    IOperationFeedbackProvider
    ICreateControl
    IGridModelSource
    System.Runtime.Serialization.ISerializable
    System.IDisposable
    System.Runtime.Serialization.IDeserializationCallback

    See Also

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