Class GridModel
Represents a wrapper class for SfDataGrid control to handle the collection and view related operations.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.UI.Xaml.Grid
Assembly: Syncfusion.SfGrid.WPF.dll
Syntax
public class GridModel : IDisposable
Remarks
GridModel class listens to the collection changes in a SfDataGrid control and responds to them. It updates the View in response to the collection changes.
Constructors
GridModel(SfDataGrid)
Initializes a new instance of GridModel class.
Declaration
public GridModel(SfDataGrid dataGrid)
Parameters
| Type | Name | Description |
|---|---|---|
| SfDataGrid | dataGrid | The SfDataGrid. |
Properties
AddNewRowController
Gets or sets the instance of GridAddNewRowController which controls AddNewRow operations in SfDataGrid.
Declaration
public GridAddNewRowController AddNewRowController { get; set; }
Property Value
| Type | Description |
|---|---|
| GridAddNewRowController | An instance of GridAddNewRowController. |
Remarks
GridAddNewRowController class provides various properties and virtual methods to customize its operations.
IsInSort
Declaration
public bool IsInSort { get; }
Property Value
| Type |
|---|
| System.Boolean |
Methods
Dispose()
Releases all the resources used by the GridModel class.
Declaration
public void Dispose()
Dispose(Boolean)
Disposes all the resources used by the GridModel class.
Declaration
protected virtual void Dispose(bool isDisposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | isDisposing | Indicates whether the call is from Dispose method or from a finalizer. |
FilterColumn(GridColumn, List<FilterPredicate>)
Declaration
public void FilterColumn(GridColumn column, List<FilterPredicate> filterPredicates)
Parameters
| Type | Name | Description |
|---|---|---|
| GridColumn | column | |
| System.Collections.Generic.List<FilterPredicate> | filterPredicates |
RefreshDataRow()
Refreshes the DataRow in view when the grid operations is performed.
Declaration
public void RefreshDataRow()
RefreshDataRow(Int32, Boolean)
Refreshes the data row from the specified row index.
Declaration
public void RefreshDataRow(int fromRowIndex, bool invalidateMeasure)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | fromRowIndex | The corresponding row index to refresh. |
| System.Boolean | invalidateMeasure | Indicates to invalidate the measurement. |
RefreshView(Boolean)
Refreshes the view.
Declaration
public void RefreshView(bool needToUpdateRowCount = true)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | needToUpdateRowCount | Indicates whether the row count is updated while updating view. |
UpdateDataRow(Int32)
Declaration
public void UpdateDataRow(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index |