Class SfGridBase
Provides the base implementation of SfDataGrid.
Implements
Namespace: Syncfusion.UI.Xaml.Grid
Assembly: Syncfusion.SfGrid.WPF.dll
Syntax
public class SfGridBase : Control, IDisposable
Constructors
SfGridBase()
Declaration
public SfGridBase()
Fields
AllowDraggingColumnsProperty
Identifies the AllowDraggingColumns dependency property.
Declaration
public static readonly DependencyProperty AllowDraggingColumnsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AllowDraggingColumns dependency property.
AllowEditingProperty
Identifies the AllowEditing dependency property.
Declaration
public static readonly DependencyProperty AllowEditingProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AllowEditing dependency property.
AllowResizingColumnsProperty
Identifies the AllowResizingColumns dependency property.
Declaration
public static readonly DependencyProperty AllowResizingColumnsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AllowResizingColumns dependency property.
AllowResizingHiddenColumnsProperty
Identifies the AllowResizingHiddenColumns dependency property.
Declaration
public static readonly DependencyProperty AllowResizingHiddenColumnsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AllowResizingHiddenColumns dependency property.
AllowSelectionOnPointerPressedProperty
Identifies the AllowSelectionOnPointerPressed dependency property.
Declaration
public static readonly DependencyProperty AllowSelectionOnPointerPressedProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AllowSelectionOnPointerPressed dependency property.
AllowSortingProperty
Identifies the AllowSorting dependency property.
Declaration
public static readonly DependencyProperty AllowSortingProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AllowSorting dependency property.
AllowTriStateSortingProperty
Identifies the AllowTriStateSorting dependency property.
Declaration
public static readonly DependencyProperty AllowTriStateSortingProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AllowTriStateSorting dependency property.
AutoGenerateColumnsForCustomTypeProperty
Identifies the AutoGenerateColumnsForCustomType dependency property.
Declaration
public static readonly DependencyProperty AutoGenerateColumnsForCustomTypeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AutoGenerateColumnsForCustomType dependency property.
AutoGenerateColumnsModeForCustomTypeProperty
Identifies the AutoGenerateColumnsModeForCustomType dependency property.
Declaration
public static readonly DependencyProperty AutoGenerateColumnsModeForCustomTypeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AutoGenerateColumnsModeForCustomType dependency property.
AutoGenerateColumnsModeProperty
Identifies the AutoGenerateColumnsMode dependency property.
Declaration
public static readonly DependencyProperty AutoGenerateColumnsModeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AutoGenerateColumnsMode dependency property.
AutoGenerateColumnsProperty
Identifies the AutoGenerateColumns dependency property.
Declaration
public static readonly DependencyProperty AutoGenerateColumnsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AutoGenerateColumns dependency property.
CellTemplateSelectorProperty
Identifies the CellTemplateSelector dependency property.
Declaration
public static readonly DependencyProperty CellTemplateSelectorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the CellTemplateSelector dependency property.
CurrentCellBorderBrushProperty
Identifies the CurrentCellBorderBrush dependency property.
Declaration
public static readonly DependencyProperty CurrentCellBorderBrushProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the CurrentCellBorderBrush dependency property.
CurrentCellBorderThicknessProperty
Identifies the CurrentCellBorderThickness dependency property.
Declaration
public static readonly DependencyProperty CurrentCellBorderThicknessProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the CurrentCellBorderThickness dependency property.
EditorSelectionBehaviorProperty
Identifies the EditorSelectionBehavior dependency property.
Declaration
public static readonly DependencyProperty EditorSelectionBehaviorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the EditorSelectionBehavior dependency property.
EditTriggerProperty
Identifies the EditTrigger dependency property.
Declaration
public static readonly DependencyProperty EditTriggerProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the EditTrigger dependency property.
FooterColumnCountProperty
Identifies the FooterColumnCount dependency property.
Declaration
public static readonly DependencyProperty FooterColumnCountProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the FooterColumnCount dependency property.
FrozenColumnCountProperty
Identifies the FrozenColumnCount dependency property.
Declaration
public static readonly DependencyProperty FrozenColumnCountProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the FrozenColumnCount dependency property.
GridCopyOptionProperty
Identifies the GridCopyOption dependency property.
Declaration
public static readonly DependencyProperty GridCopyOptionProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the GridCopyOption dependency property.
GridLinesVisibilityProperty
Identifies the GridLinesVisibility dependency property.
Declaration
public static readonly DependencyProperty GridLinesVisibilityProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the GridLinesVisibility dependency property.
GridPasteOptionProperty
Identifies the GridPasteOption dependency property.
Declaration
public static readonly DependencyProperty GridPasteOptionProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the GridPasteOption dependency property.
GridValidationModeProperty
Identifies the GridValidationMode dependency property.
Declaration
public static readonly DependencyProperty GridValidationModeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the GridValidationMode dependency property.
HeaderContextMenuProperty
Identifies the HeaderContextMenu dependency property.
Declaration
public static readonly DependencyProperty HeaderContextMenuProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the HeaderContextMenu dependency property.
HeaderLinesVisibilityProperty
Identifies the HeaderLinesVisibility dependency property.
Declaration
public static readonly DependencyProperty HeaderLinesVisibilityProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the HeaderLinesVisibility dependency property.
HeaderRowHeightProperty
Identifies the HeaderRowHeight dependency property.
Declaration
public static readonly DependencyProperty HeaderRowHeightProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the HeaderRowHeight dependency property.
IsReadOnlyProperty
Identifies the IsReadOnly dependency property.
Declaration
public static readonly DependencyProperty IsReadOnlyProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the IsReadOnly dependency property.
NavigationModeProperty
Identifies the NavigationMode dependency property.
Declaration
public static readonly DependencyProperty NavigationModeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the NavigationMode dependency property.
RecordContextMenuProperty
Identifies the RecordContextMenu dependency property.
Declaration
public static readonly DependencyProperty RecordContextMenuProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the RecordContextMenu dependency property.
RowHeaderWidthProperty
Identifies the RowHeaderWidth dependency property.
Declaration
public static readonly DependencyProperty RowHeaderWidthProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the RowHeaderWidth dependency property.
RowHeightProperty
Identifies the RowHeight dependency property.
Declaration
public static readonly DependencyProperty RowHeightProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the RowHeight dependency property.
SelectedIndexProperty
Identifies the SelectedIndex dependency property.
Declaration
public static readonly DependencyProperty SelectedIndexProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the SelectedIndex dependency property.
SelectedItemProperty
Identifies the SelectedItem dependency property.
Declaration
public static readonly DependencyProperty SelectedItemProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the SelectedItem dependency property.
SelectedItemsProperty
Identifies the SelectedItems dependency property.
Declaration
public static readonly DependencyProperty SelectedItemsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the SelectedItems dependency property.
SelectionModeProperty
Identifies the SelectionMode dependency property.
Declaration
public static readonly DependencyProperty SelectionModeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the SelectionMode dependency property.
ShowRowHeaderProperty
Identifies the ShowRowHeader dependency property.
Declaration
public static readonly DependencyProperty ShowRowHeaderProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the ShowRowHeader dependency property.
ShowSortNumbersProperty
Identifies the ShowSortNumbers dependency property.
Declaration
public static readonly DependencyProperty ShowSortNumbersProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the ShowSortNumbers dependency property.
ShowToolTipProperty
Identifies the ShowToolTip dependency property.
Declaration
public static readonly DependencyProperty ShowToolTipProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the ShowToolTip dependency property.
SortClickActionProperty
Identifies the SortClickAction dependency property.
Declaration
public static readonly DependencyProperty SortClickActionProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the SortClickAction dependency property.
SortColumnDescriptionsProperty
Identifies the SortColumnDescriptions dependency property.
Declaration
public static readonly DependencyProperty SortColumnDescriptionsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the SortColumnDescriptions dependency property.
StackedHeaderRowsProperty
Identifies the StackedHeaderRows dependency property.
Declaration
public static readonly DependencyProperty StackedHeaderRowsProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the StackedHeaderRows dependency property.
Properties
AllowDraggingColumns
Gets or sets a value that indicates whether the column can be repositioned by using mouse or touch.
Declaration
public bool AllowDraggingColumns { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the column can be repositioned by using mouse or touch; otherwise, false. The default value is false. |
Remarks
For SfDataGrid, the dragging operation can be customized through
AllowEditing
Gets or sets a value that indicates whether the user can edit the cells.
Declaration
public bool AllowEditing { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if user can edit the cells; otherwise, false. The default value is false. |
Remarks
CurrentCellBeginEdit and CurrentCellEndEdit events occurs when editing starts for current cell and editing ends for current cell in SfDataGrid. CurrentCellBeginEdit and CurrentCellEndEdit events occurs when editing starts for current cell and editing ends for current cell in SfTreeGrid.
See Also
AllowResizingColumns
Gets or sets a value that indicates whether the user can adjust the column width by using the mouse.
Declaration
public bool AllowResizingColumns { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the columns are allowed for resizing;otherwise,false.The default value is false. |
Remarks
For SfDataGrid you can cancel or customize the resizing operations through ResizingColumns event handler. For SfTreeGrid you can cancel or customize the resizing operations through ResizingColumns event handler.
AllowResizingHiddenColumns
Gets or sets a value that indicates whether the hidden column can be resized using the mouse.
Declaration
public bool AllowResizingHiddenColumns { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the resizing can be enabled for the hidden columns; otherwise, false. The default value is false. |
AllowSelectionOnPointerPressed
Gets or sets a value that indicates whether the selection should be present in the PointerPressed state.
Declaration
public bool AllowSelectionOnPointerPressed { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the row or cell can be selected in PointerPressed; otherwise, false. The default value is false. |
AllowSorting
Gets or sets a value that indicates whether the user can sort the data by clicking on its header cell of the column.
Declaration
public bool AllowSorting { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the sorting is enabled; otherwise, false. The default value is true. |
Remarks
For SfDataGrid, the
See Also
AllowTriStateSorting
Gets or sets a value that indicates whether the user can sort the data to its initial order other than ascending or descending order.
Declaration
public bool AllowTriStateSorting { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the data can be arranged to initial order; otherwise, false. The default value is false. |
AutoGenerateColumns
Gets or sets a value that indicates whether the columns should be created automatically.
Declaration
public bool AutoGenerateColumns { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the columns can be automatically generated; otherwise, false. The default value is true. |
Remarks
For SfDataGrid, each column gets notified in the AutoGeneratingColumn event during its creation. For SfTreeGrid, each column gets notified in the AutoGeneratingColumn event during its creation. You can cancel or customize the column being created by using this event.
See Also
AutoGenerateColumnsForCustomType
Gets or sets a value that indicates whether to generate columns automatically for the custom types in data object.
Declaration
public bool AutoGenerateColumnsForCustomType { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the custom type properties are automatically generated; otherwise, false. The default value is false. |
Remarks
Setting AutoGenerateColumnsForCustomType to true, generate columns for inner properties.For example, OrderInfo class has Customer property of type Customer, then column generated like Customer.CustomerID.
AutoGenerateColumnsMode
Gets or sets a value that indicates how the columns are generated during automatic column generation.
Declaration
public AutoGenerateColumnsMode AutoGenerateColumnsMode { get; set; }
Property Value
Type | Description |
---|---|
AutoGenerateColumnsMode | One of the |
AutoGenerateColumnsModeForCustomType
Gets or sets the AutoGenerateColumnsModeForCustomType that indicates whether to create the columns for custom parent type or child inner properties or custom type and its child properties.
Declaration
public AutoGenerateColumnsModeForCustomType AutoGenerateColumnsModeForCustomType { get; set; }
Property Value
Type | Description |
---|---|
AutoGenerateColumnsModeForCustomType | One of the AutoGenerateColumnsModeForCustomType enumeration that specified how the custom type columns are auto generated. The default is Child. |
Remarks
By default, the columns are created for custom type child properties.
CellTemplateSelector
Gets or sets the System.Windows.DataTemplate by choosing a template conditionally based on data.
Declaration
public DataTemplateSelector CellTemplateSelector { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Controls.DataTemplateSelector | A custom System.Windows.Controls.DataTemplateSelector object that chooses the System.Windows.DataTemplate based on data. The default value is null. |
See Also
CurrentCellBorderBrush
Gets or sets a brush that is used to draw the border color of the current cell.
Declaration
public Brush CurrentCellBorderBrush { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Media.Brush | The border color of the current cell. The default value is black. |
See Also
CurrentCellBorderThickness
Gets or sets the width for the boundaries of the current cell border.
Declaration
public Thickness CurrentCellBorderThickness { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Thickness | The width of the current cell border. The default value is 2. |
See Also
EditorSelectionBehavior
Declaration
public EditorSelectionBehavior EditorSelectionBehavior { get; set; }
Property Value
Type | Description |
---|---|
EditorSelectionBehavior | One of the EditorSelectionBehavior enumeration that denotes the position of cursor and selection in edit mode. The default value is SelectAll. |
See Also
EditTrigger
Gets or sets a value that indicates the mouse action that triggers editing.
Declaration
public EditTrigger EditTrigger { get; set; }
Property Value
Type | Description |
---|---|
EditTrigger | One of the EditTrigger enumeration that specifies the mouse action that triggers the editing. The default value is OnDoubleTap. |
See Also
FooterColumnCount
Gets or sets the number of non-scrolling columns at right of the grid.
Declaration
[Cloneable(false)]
public int FooterColumnCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of non-scrolling columns at right. The default value is zero. |
Remarks
Footer columns are always displayed and it can't be scrolled out of visibility.
FrozenColumnCount
Gets or sets the number of non-scrolling columns at left of the grid.
Declaration
[Cloneable(false)]
public int FrozenColumnCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of non-scrolling columns at left. The default value is zero. |
Remarks
Frozen columns are always displayed and it can't be scrolled out of visibility.
GridCopyOption
Gets or sets a value that indicates how the content is copied from control to the clipboard.
Declaration
public GridCopyOption GridCopyOption { get; set; }
Property Value
Type | Description |
---|---|
GridCopyOption | One of the GridCopyOption enumeration that specifies how the content is copied from control to the clipboard. The default value is CopyData. |
Remarks
You can cancel or customize the copy operation through GridCopyContent and CopyGridCellContent event handlers in SfDataGrid. You can cancel or customize the copy operation through CopyContent and CopyCellContent event handlers in SfTreeGrid.
See Also
GridLinesVisibility
Gets or sets a value that specifies the horizontal and vertical lines visibility of the cells in grid (except header cells).
Declaration
public GridLinesVisibility GridLinesVisibility { get; set; }
Property Value
Type | Description |
---|---|
GridLinesVisibility | The default value is Both. |
Remarks
By default, vertical and horizontal lines are visible in grid. You can hide both grid lines, or either one of the using GridLinesVisibility property. This is applicable for caption row, summary rows, filter row.
See Also
GridPasteOption
Gets or sets a value that indicates how the clipboard value is pasted.
Declaration
public GridPasteOption GridPasteOption { get; set; }
Property Value
Type | Description |
---|---|
GridPasteOption | One of the GridPasteOption enumeration that specifies how the clipboard value is pasted. The default value is PasteData. |
Remarks
You can customize or cancel the paste operations through GridPasteContent and PasteGridCellContent event handlers in SfDataGrid. You can cancel or customize the paste operations through PasteContent and PasteCellContent event handlers in SfTreeGrid.
See Also
GridValidationMode
Gets or sets a value to enable the built-in validation (IDataErrorInfo/DataAnnonations) to validate the user input and displays the error.
Declaration
public GridValidationMode GridValidationMode { get; set; }
Property Value
Type | Description |
---|---|
GridValidationMode | One of the GridValidationMode enumeration that specifies how the row or cell is validated. The default mode is None. |
Remarks
The GridValidationMode process the built-in validations when data object implements System.ComponentModel.IDataErrorInfo,System.ComponentModel.INotifyDataErrorInfo and System.ComponentModel.DataAnnotations. The validation can also be done using CurrentCellValidating and RowValidating events.
HeaderContextMenu
Gets or sets the shortcut menu that appears on each header cells.
Declaration
public ContextMenu HeaderContextMenu { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Controls.ContextMenu | The shortcut menu for each header cells. The default value is null. |
Remarks
Command bound with MenuItem receives GridColumnContextMenuInfo for SfDataGrid and MenuFlyoutItem receives TreeGridColumnContextMenuInfo for SfTreeGrid as command parameter which contains the corresponding record.
HeaderLinesVisibility
Gets or sets a value that specifies the horizontal and vertical lines visibility of the stacked header cells and header cells in grid.
Declaration
public GridLinesVisibility HeaderLinesVisibility { get; set; }
Property Value
Type | Description |
---|---|
GridLinesVisibility | The default value is Both. |
See Also
HeaderRowHeight
Gets or sets the height of header row.
Declaration
public double HeaderRowHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The height of the header row. |
Remarks
Header row can be hide by setting HeaderRowHeight as zero.
IsReadOnly
Gets or sets the value that determines if the user can change the text in the GridCell.
Declaration
public bool IsReadOnly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | trueif the GridCell is in read-only state; otherwise, false. The default value is false. |
Remarks
If the GridCell is read-only state, no user input or edits are allowed, but programmatic changes can be made. The user can still select text, and the key events are marked as handled. The difference between the AllowEditing and IsReadOnly behavior is user input. AllowEditing allows the user inputs but IsReadOnly won't allow.
NavigationMode
Gets or sets the NavigationMode that indicates whether the navigation can be accomplished based on either cell or row.
Declaration
public NavigationMode NavigationMode { get; set; }
Property Value
Type | Description |
---|---|
NavigationMode | One of the NavigationMode enumeration that specifies the navigation based on either row or cell. The default registered mode is Cell. |
See Also
RecordContextMenu
Gets or sets the shortcut menu that appears on each record cells.
Declaration
public ContextMenu RecordContextMenu { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Controls.ContextMenu | The shortcut menu for each record. The default value is null. |
Remarks
Command bound with MenuItem receives GridRecordContextMenuInfo for SfDataGrid and MenuFlyoutItem receives TreeGridNodeContextMenuInfo for SfTreeGrid as command parameter which contains the corresponding record.
RowHeaderWidth
Gets or sets the width of the RowHeader.
Declaration
public double RowHeaderWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The width of the RowHeader. |
Remarks
RowHeader can be enabled by setting ShowRowHeader as true.
RowHeight
Gets or sets the height for record rows.
Declaration
public double RowHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The height of record row. |
Remarks
Particular record row height can be changed by specifying row index in VisualContainer.RowHeights
for SfDataGrid and TreeGridPanel.RowHeights
for SfTreeGrid.
Once row heights are changed, need to call the InvalidateMeasureInfo method of VisualContainer for SfDataGrid and TreeGridPanel for SfTreeGrid to refresh the view.
Examples
using Syncfusion.UI.Xaml.Grid.Helpers;
var visualContainer = this.dataGrid.GetVisualContainer();
//Set RowHeight to 2'nd row
visualContainer.RowHeights[2] = 50;
visualContainer.InvalidateMeasure();
using Syncfusion.UI.Xaml.TreeGrid.Helpers;
CreateColumn(PropertyInfo
var treeGridPanel = this.treeGrid.GetTreePanel();
//Set RowHeight to 2'nd row
treeGridPanel.RowHeights[2] = 50;
treeGridPanel.InvalidateMeasure();
See Also
SelectedIndex
Gets or sets the index of corresponding selected cell or row.
Declaration
[Cloneable(false)]
public int SelectedIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The index of the selected item. The default value is -1. |
SelectedItem
Gets or sets the data item bound to the row or cell that contains the current cell.
Declaration
[Cloneable(false)]
public object SelectedItem { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The object that is the currently selected item or null if there is no currently selected item. |
SelectedItems
Gets the collection of object that contains data item of corresponding to the selected cells or rows.
Declaration
[Cloneable(false)]
public ObservableCollection<object> SelectedItems { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<System.Object> | The collection of object that contains data item corresponding to the selected cells or rows. |
SelectionMode
Gets or sets the value that indicates how the rows or cells are selected.
Declaration
public GridSelectionMode SelectionMode { get; set; }
Property Value
Type | Description |
---|---|
GridSelectionMode | One of the GridSelectionMode enumeration that specifies the selection behavior. The default value is Single. |
See Also
ShowRowHeader
Gets or sets a value that indicates the visibility of RowHeader column which is used to denote the status of row.
Declaration
public bool ShowRowHeader { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the RowHeader is visible; otherwise, false. The default value is false. |
Remarks
RowHeader is a special column used to indicate the status of row (current row, editing status, errors in row, etc.) which is placed as first cell of each row.
See Also
ShowSortNumbers
Gets or sets a value that indicates whether the sequence number should be displayed on the header cell of sorted column during multi-column sorting.
Declaration
public bool ShowSortNumbers { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the sequence number is displayed on the header cell of sorted column; otherwise, false. The default value is false. |
Remarks
The multi-column sorting can be applied by pressing CTRL key and the corresponding sequence number is displayed on its header cell of the column simultaneously.
ShowToolTip
Gets or sets value that indicates whether the tooltip should be displayed when mouse hovered on the cells in the control.
Declaration
public bool ShowToolTip { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the tool tip is enabled in the column; otherwise, false. The default value is false. |
Examples
<Page.Resources>
<DataTemplate x:Key="orderIDColumnToolTip">
<Grid>
<Rectangle Fill = "Transparent" />
< TextBlock Text="{Binding OrderID}" FontWeight="Bold" Foreground="Red" />
</Grid>
</DataTemplate>
</Page.Resources>
<syncfusion:SfDataGrid.Columns>
<syncfusion:GridTextColumn HeaderText = "Order ID" ShowToolTip="True" ToolTipTemplate="{StaticResource orderIDColumnToolTip}" MappingName="OrderID" >
<syncfusion:SfDataGrid.Columns>
SortClickAction
Gets or sets a value that indicates whether the user can sort the data either at single or double click.
Declaration
public SortClickAction SortClickAction { get; set; }
Property Value
Type | Description |
---|---|
SortClickAction | One of the SortClickAction enumeration that specifies the sort click action. The default value is SingleClick. |
SortColumnDescriptions
Gets or sets the collection of SortColumnDescription objects to sort the data programmatically.
Declaration
[Cloneable(false)]
public SortColumnDescriptions SortColumnDescriptions { get; set; }
Property Value
Type | Description |
---|---|
SortColumnDescriptions | The collection of SortColumnDescription object to sort the data programmatically. The default value is null. |
Examples
this.dataGrid.SortColumnDescriptions.Add(new SortColumnDescription() { ColumnName = "OrderID", SortDirection = ListSortDirection.Ascending });
this.dataGrid.SortColumnDescriptions.Add(new SortColumnDescription() { ColumnName = "CustomerName", SortDirection = ListSortDirection.Descending });
StackedHeaderRows
Gets or sets the collection of StackedHeaderRow to add additional headers to group and display the column headers.
Declaration
[Cloneable(false)]
public StackedHeaderRows StackedHeaderRows { get; set; }
Property Value
Type | Description |
---|---|
StackedHeaderRows | The collection of StackedHeaderRow. The default value is null. |
Examples
// control may be SfDataGrid or SfTreeGrid.
var stackedHeaderRow1 = new StackedHeaderRow();
stackedHeaderRow1.StackedColumns.Add(new StackedColumn() { ChildColumns = "OrderID,OrderDate,Quantity,UnitPrice,ShipCity,ShipAddress" , HeaderText = "Sales Details", MappingName = "SalesDetails" });
this.grid.StackedHeaderRows.Add(stackedHeaderRow1);
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(Boolean)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Indicates whether the call is from dispose method or from a finalizer. |