WinForms

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridComboBoxCellModel - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class GridComboBoxCellModel

    Implements the data or model part for a combo box cell.

    Inheritance
    System.Object
    NonFinalizeDisposable
    Disposable
    GridCellModelBase
    GridStaticCellModel
    GridTextBoxCellModel
    GridDropDownCellModel
    GridComboBoxCellModel
    GridTableFilterBarExtCellModel
    GridDropDownGridListControlCellModel
    GridTableFilterBarCellModel
    Implements
    System.Runtime.Serialization.ISerializable
    System.IDisposable
    Inherited Members
    GridDropDownCellModel.GetObjectData(SerializationInfo, StreamingContext)
    GridDropDownCellModel.OnQueryPrefferedClientSize(Graphics, Int32, Int32, GridStyleInfo, GridQueryBounds)
    GridDropDownCellModel.SupportsChoiceList
    GridStaticCellModel.OnQueryCanMergeCell(Int32, Int32, GridStyleInfo, GridMergeCellDirection)
    GridStaticCellModel.OnQueryCanFloatCell(Int32, Int32, GridStyleInfo, GridQueryFloatCell)
    GridStaticCellModel.AllowFloating
    GridStaticCellModel.AllowMerging
    GridCellModelBase.Dispose()
    GridCellModelBase.OnBindingContextChanged(EventArgs)
    GridCellModelBase.GetLocalizedString(String)
    GridCellModelBase.OnModelDeserialization(Object, GridModel)
    GridCellModelBase.CreateCopy(GridModel)
    GridCellModelBase.SubtractBorders(Rectangle, GridStyleInfo, Boolean)
    GridCellModelBase.SubtractBorders(Rectangle, GridStyleInfo)
    GridCellModelBase.CalculatePreferredCellSize(Graphics, Int32, Int32, GridStyleInfo, GridQueryBounds)
    GridCellModelBase.MeasureSampleWString(Graphics, Font)
    GridCellModelBase.GetCellSize(Int32, Int32)
    GridCellModelBase.GetCellClientSize(Int32, Int32, GridStyleInfo)
    GridCellModelBase.GetFormattedOrActiveTextAt(Int32, Int32, GridStyleInfo)
    GridCellModelBase.GetText(GridStyleInfo, Object)
    GridCellModelBase.ApplyText(GridStyleInfo, String)
    GridCellModelBase.SetActiveText(Int32, Int32, String)
    GridCellModelBase.GetActiveText(Int32, Int32)
    GridCellModelBase.OnActiveTextChanged(GridCellEventArgs)
    GridCellModelBase.ResetActiveText(Int32, Int32)
    GridCellModelBase.GetPropertyDescriptor(GridStyleInfo)
    GridCellModelBase.GetTypeConverter(GridStyleInfo)
    GridCellModelBase.IsDisposing
    GridCellModelBase.IsDisposed
    GridCellModelBase.ForceCoveredCellFullBounds
    GridCellModelBase.BindingContext
    GridCellModelBase.Description
    GridCellModelBase.SerializeSchemeVersion
    GridCellModelBase.Grid
    GridCellModelBase.ButtonBarSize
    GridCellModelBase.MeasureEmptyCellString
    GridCellModelBase.ActiveTextChanged
    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 GridComboBoxCellModel : GridDropDownCellModel, ISerializable, IDisposable
    Remarks

    You typically access cell models through the CellModels property of the GridModel class.

    A GridComboBoxCellModel can serve as model for several GridComboBoxCellRenderer instances if there are several GridControlBase views for a GridModel.

    See GridComboBoxCellRenderer for more detailed information about this cell type.

    Constructors

    GridComboBoxCellModel(GridModel)

    Initializes a new GridComboBoxCellModel object and stores a reference to the GridModel this cell belongs to.

    Declaration
    public GridComboBoxCellModel(GridModel grid)
    Parameters
    Type Name Description
    GridModel grid

    The GridModel for this cell model.

    Remarks

    You typically access cell models through the CellModels property of the GridModel class.

    GridComboBoxCellModel(SerializationInfo, StreamingContext)

    Initializes a new GridComboBoxCellModel from a serialization stream.

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

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

    System.Runtime.Serialization.StreamingContext context

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

    Properties

    AllowDoubleClickChangeSelectedIndex

    Gets or sets a value indicating whether to enable or turn off selecting the next index when user double clicks inside cell.

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

    CacheDataSource

    Declaration
    [Obsolete("Problem with sluggish list boxes has been fixed. Set also GridStyleInfoStore.DataSourceProperty.IsCloneable and GridStyleInfoStore.DataSourceProperty.IsDisposable = false")]
    public bool CacheDataSource { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    ApplyFormattedText(GridStyleInfo, String, Int32)

    Parses the display text and converts it into a cell value to be stored in the style object.

    Declaration
    public override bool ApplyFormattedText(GridStyleInfo style, string text, int textInfo)
    Parameters
    Type Name Description
    GridStyleInfo style

    The GridStyleInfo object that holds cell information.

    System.String text

    The input text to be parsed.

    System.Int32 textInfo

    textInfo is a hint who is calling, default is GridCellBaseTextInfo.DisplayText

    Returns
    Type Description
    System.Boolean

    True if value was parsed correctly and saved in style object as CellValue; False otherwise.

    Overrides
    GridCellModelBase.ApplyFormattedText(GridStyleInfo, String, Int32)

    CreateRenderer(GridControlBase)

    Creates a GridComboBoxCellRenderer for this cell model that is specific to the GridControlBase.

    Declaration
    public override GridCellRendererBase CreateRenderer(GridControlBase control)
    Parameters
    Type Name Description
    GridControlBase control

    The GridControlBase the cell renderer is created for.

    Returns
    Type Description
    GridCellRendererBase

    A new GridComboBoxCellRenderer specific for a GridControlBase.

    Overrides
    GridDropDownCellModel.CreateRenderer(GridControlBase)
    Examples

    This example shows how to create the renderer for the cell model.

     GridCellModelBase cellModel = grid.Model.CellModels[key];
     GridCellRendererBase renderer = cellModel.CreateRenderer(grid);

    Dispose(Boolean)

    Disposes the unmanaged resources.

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

    FillWithChoices(ListBox, GridStyleInfo, out Boolean)

    Initializes a System.Windows.Form.ListBox with data binding information from a GridStyleInfo object.

    Declaration
    public virtual void FillWithChoices(ListBox listBox, GridStyleInfo style, out bool exclusive)
    Parameters
    Type Name Description
    System.Windows.Forms.ListBox listBox

    The list box to be initialized with data binding information

    GridStyleInfo style

    The style object with binding information.

    System.Boolean exclusive

    A place holder that returns whether the list box is filled with an exclusive list of possible choices or if non-standard values are allowed.

    FindValue(GridStyleInfo, Object)

    Returns the index in the drop-down list box for the specified cell value / key.

    Declaration
    public int FindValue(GridStyleInfo style, object value)
    Parameters
    Type Name Description
    GridStyleInfo style

    The GridStyleInfo object that holds cell information.

    System.Object value

    The value (same as ValueMember).

    Returns
    Type Description
    System.Int32

    The index in the drop-down list box or -1 if not found.

    GetDataSource(GridStyleInfo)

    This is called to initialize data source on demand. This lets you calculate the data source 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 GetDataSource(GridStyleInfo style)
    Parameters
    Type Name Description
    GridStyleInfo style

    The style object with binding information.

    Returns
    Type Description
    System.Object

    Data source.

    GetFormattedText(GridStyleInfo, Object, Int32)

    This is called from GridStyleInfo.GetFormattedText. GridStyleInfo.CultureInfo is used for conversion to string.

    Declaration
    public override string GetFormattedText(GridStyleInfo style, object value, int textInfo)
    Parameters
    Type Name Description
    GridStyleInfo style

    The GridStyleInfo object that holds cell information.

    System.Object value

    The value to format.

    System.Int32 textInfo

    textInfo is a hint who is calling, default is GridCellBaseTextInfo.DisplayText.

    Returns
    Type Description
    System.String

    The formatted text for the given value.

    Overrides
    GridTextBoxCellModel.GetFormattedText(GridStyleInfo, Object, Int32)

    GetItemValue(Object, String, Object)

    Returns the value for the ValueMember of the specified item.

    Declaration
    public object GetItemValue(object dataSource, string valueMember, object item)
    Parameters
    Type Name Description
    System.Object dataSource

    The data source list

    System.String valueMember

    The name of the value member

    System.Object item

    The row item.

    Returns
    Type Description
    System.Object

    The value of the ValueMember.

    Implements

    System.Runtime.Serialization.ISerializable
    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2022 Syncfusion Inc. All Rights Reserved