Class GridCellDropDownCellModel<T>
Implements the model part for drop-down list cells.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Controls.Grid
Assembly: Syncfusion.Grid.Wpf.dll
Syntax
public class GridCellDropDownCellModel<T> : GridCellModel<T>, IDisposable, IGridListModel where T : IGridCellRenderer, new()
Type Parameters
Name |
---|
T |
Constructors
GridCellDropDownCellModel()
Initializes a new
Declaration
public GridCellDropDownCellModel()
Properties
ListModel
Returns the model of the drop-down list control.
Declaration
public GridListModel ListModel { get; }
Property Value
Type |
---|
GridListModel |
Methods
ApplyFormattedText(GridStyleInfo, String, Int32)
Parses the display text and converts it into a cell value based on the ChoiceList or ItemsSource, DisplayMember and ValueMember of the combobox cell.
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
CalculatePreferredCellSize(Int32, Int32, GridStyleInfo, GridQueryBounds)
Calculates the preferred size of the drop-down list cell based on its content, including cell margins.
Declaration
public override Size CalculatePreferredCellSize(int rowIndex, int colIndex, GridStyleInfo style, GridQueryBounds queryBounds)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | Cell row index. |
System.Int32 | colIndex | Cell column index. |
GridStyleInfo | style | Cell style information. |
GridQueryBounds | queryBounds | Graphical bounds. |
Returns
Type | Description |
---|---|
System.Windows.Size | The optimal size of the cell. |
Overrides
FillWithChoices(GridStyleInfo, out Boolean)
Initializes a ListModel with data binding information from a GridStyleInfo object.
Declaration
public virtual void FillWithChoices(GridStyleInfo style, out bool exclusive)
Parameters
Type | Name | Description |
---|---|---|
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 datasource only when it is needed and not every time in QueryStyleInfo. Default behavior is to return style.ChoiceList if not empty. If style.ChoiceList is empty, style.ItemsSource is returned.
Declaration
public virtual IEnumerable GetDataSource(GridStyleInfo style)
Parameters
Type | Name | Description |
---|---|---|
GridStyleInfo | style | The cell style information. |
Returns
Type | Description |
---|---|
System.Collections.IEnumerable | The style datasource. |
GetFormattedText(GridStyleInfo, Object, Int32)
This is called from GridStyleInfo.GetFormattedText.
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
GetItemValue(Object, String, Object)
Returns the value for the ValueMember of the specified item.
Declaration
public object GetItemValue(object itemsSource, string valueMember, object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | itemsSource | The 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. |
GetText(GridStyleInfo, Object)
This is called from GridStyleInfo.GetText (ignoring any Format settings).
Declaration
public override string GetText(GridStyleInfo style, object value)
Parameters
Type | Name | Description |
---|---|---|
GridStyleInfo | style | The GridStyleInfo object that holds cell information. |
System.Object | value | The value to convert to a string. |
Returns
Type | Description |
---|---|
System.String | The string that represents the given value. |
Overrides
OnQueryPrefferedClientSize(Int32, Int32, GridStyleInfo, GridQueryBounds)
Calculates the preferred size of the cell based on its contents without margins and any buttons.
Declaration
protected override Size OnQueryPrefferedClientSize(int rowIndex, int colIndex, GridStyleInfo style, GridQueryBounds queryBounds)
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. |
GridQueryBounds | queryBounds |
Returns
Type | Description |
---|---|
System.Windows.Size | The optimal size of the cell. |