WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridModelRowStylesIndexer

    Show / Hide Table of Contents

    Class GridModelRowStylesIndexer

    Implements the functionalities that provides access to a grid row styles collection with an indexer.

    Inheritance
    System.Object
    NonFinalizeDisposable
    GridModelBound
    GridModelRowStylesIndexer
    Implements
    System.IDisposable
    System.Collections.ICollection
    System.Collections.IEnumerable
    Inherited Members
    GridModelBound.Dispose(Boolean)
    GridModelBound.OnModelDeserialization(Object, GridModel)
    GridModelBound.SetModelInt(GridModel)
    GridModelBound.Model
    NonFinalizeDisposable.Dispose()
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Windows.Forms.Grid
    Assembly: Syncfusion.Grid.Windows.dll
    Syntax
    public class GridModelRowStylesIndexer : GridModelBound, IDisposable, ICollection, IEnumerable
    Remarks

    You typically access this class from a grid with the ColStyles property of a GridModel

    Properties

    Count

    Gets the number of rows in the grid RowCount.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    System.Int32

    IsSynchronized

    Gets a value indicating whether Is Synchronized. Always false.

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

    Item[Int32]

    Gets or sets the row style information of a row.

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

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

    Examples

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

                model.RowStyles[2].Font.Bold = true;
                model.RowStyles[2].Font.Size = 16;
                model.RowStyles[2].HorizontalAlignment = GridHorizontalAlignment.Center;
                model.RowStyles[2].VerticalAlignment = GridVerticalAlignment.Middle;
                model.RowStyles[2].CellType = "Static";
                model.RowStyles[2].Borders.All = new GridBorder(GridBorderStyle.Solid, Color.FromArgb(100, 238, 122, 3));
                model.RowStyles[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.

                model.RowStyles[1].TextColor = Color.FromArgb(0, 21, 84);
                    Color color = model[1, 1].TextColor;
                    // model[1, 1].TextColor will return Color.FromArgb(0, 21, 84));

    Item[String]

    Gets or sets the row style information of a row.

    Declaration
    public GridStyleInfo this[string name] { get; set; }
    Parameters
    Type Name Description
    System.String name
    Property Value
    Type Description
    GridStyleInfo

    SyncRoot

    Gets a reference to the Data property of the GridModel.

    Declaration
    public object SyncRoot { get; }
    Property Value
    Type Description
    System.Object

    Methods

    CopyTo(GridStyleInfo[], Int32)

    Copies the GridModelColStylesIndexer elements to a one-dimensional System.Array at the specified index.

    Declaration
    public void CopyTo(GridStyleInfo[] array, int index)
    Parameters
    Type Name Description
    GridStyleInfo[] array

    The one-dimensional System.Array that is the destination of the System.Collections.DictionaryEntry objects copied from the GridModelColStylesIndexer instance. The System.Array must have zero-based indexing.

    System.Int32 index

    The zero-based index in array at which copying begins.

    GetEnumerator()

    Returns an System.Collections.IEnumerator that can iterate through the column styles in the GridModelColStylesIndexer instance.

    Declaration
    public IEnumerator GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator

    An System.Collections.IEnumerator for the GridModelColStylesIndexer instance.

    Explicit Interface Implementations

    ICollection.CopyTo(Array, Int32)

    Declaration
    void ICollection.CopyTo(Array array, int index)
    Parameters
    Type Name Description
    System.Array array
    System.Int32 index

    Implements

    System.IDisposable
    System.Collections.ICollection
    System.Collections.IEnumerable

    Extension Methods

    EnumerableExtensions.GetElementType(IEnumerable)
    EnumerableExtensions.GetItemPropertyInfo(IEnumerable)
    FunctionalExtensions.ForEach<T>(IEnumerable, Action<T>)
    FunctionalExtensions.ToList<T>(IEnumerable)
    QueryableExtensions.OfQueryable(IEnumerable)
    QueryableExtensions.OfQueryable(IEnumerable, Type)
    QueryableExtensions.GroupByMany<TElement>(IEnumerable, Type, List<Func<TElement, Object>>)
    QueryableExtensions.GroupByMany(IEnumerable, Type, Func<String, Expression>, String[])
    QueryableExtensions.GroupByMany(IEnumerable, Type, List<SortDescriptor>, Dictionary<String, IComparer<Object>>, Func<String, Expression>, String[])
    QueryableExtensions.GroupByMany(IEnumerable, Type, List<SortDescriptor>, Func<String, Expression>, String[])
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved