Class GridTreeControlImpl
A GridControl derived class that displays multicolumn tree data in a tree-like grid. You populate the tree by handling a single event, RequestTreeItems in which you return a list of object belong to a particular node.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Controls.Grid
Assembly: Syncfusion.Grid.Wpf.dll
Syntax
public class GridTreeControlImpl : GridControl, IScrollBarProvider, IScrollInfo, IDisposable, IGridPrintPaginator, ISupportsRecordSelection<GridTreeNode>, ISupportsSortStates
Remarks
While handling RequestTreeItems is the only thing required for data to appear in your tree, you can use additional property setting to customized the look and feel of the tree. You use the Columns collection to define content and order of the multiple columns appearing in the tree. For each column, you can specify Column.StyleInfo which is a GridStyleInfo object that controls the grid cell display properties (like BackColor, Format, Fonts, etc.) of a the column.
The TreeGrid also supports sorting by clicking on a column header. There are also tree-wide properties like ReadOnly, SupportRowSizing, MarkRowBrush, ColumnHeaderStyle, RowHeaderStyle, FreezeExpandColumn, LevelStyles, RowHeaderWidth, ShowColumnHeaders, ShowColumnHeaderBorders, SortingEnabled and ShowRowHeaders that allow you to control the look and feel of the tree grid.
The TreeGridControl is bound to a collection of GridNode objects found in TreeGridControl.Nodes. There is a one to one mapping between the rows in the underlying GridControl and GridNodes in TreeGridControl.Nodes. Given a GridNode, you can get at the underlying data object passed in via the RequestTreeItems event by referencing GridNode.Item.
Constructors
GridTreeControlImpl()
Default Constructor.
Declaration
public GridTreeControlImpl()
Fields
AutoGenerateColumnsInfoProperty
Declaration
public static readonly DependencyProperty AutoGenerateColumnsInfoProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
AutoPopulateColumnsProperty
Declaration
public static readonly DependencyProperty AutoPopulateColumnsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
CreatingTreeNode
Event raised whenever a new GridTreeNode is needed so derived GridTreeNodes can be used if desired.
Declaration
public GridTreeCreatingNodeHandler CreatingTreeNode
Field Value
| Type |
|---|
| GridTreeCreatingNodeHandler |
CustomVisualStyleProperty
DependencyProperty for CustomVisualStyle.
Declaration
public static readonly DependencyProperty CustomVisualStyleProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
EnableLegacyStyleProperty
Declaration
public static readonly DependencyProperty EnableLegacyStyleProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ExpandNewNodeOnCreationProperty
Dependency Registartion for Expand New Node on Creation
Declaration
public static readonly DependencyProperty ExpandNewNodeOnCreationProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
RequestNodeImageEvent
Declaration
public static readonly RoutedEvent RequestNodeImageEvent
Field Value
| Type |
|---|
| System.Windows.RoutedEvent |
RequestTreeItemsEvent
Declaration
public static readonly RoutedEvent RequestTreeItemsEvent
Field Value
| Type |
|---|
| System.Windows.RoutedEvent |
TrackSelectionOnCollectionChangeProperty
Declaration
public static readonly DependencyProperty TrackSelectionOnCollectionChangeProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
VisualStyleProperty
DependencyProperty for VisualStyle.
Declaration
public static readonly DependencyProperty VisualStyleProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
Properties
AllowAutoSizingNodeColumn
Gets or sets whether the tree node column's width is automatically adjusted as the node levels increase.
Declaration
public bool AllowAutoSizingNodeColumn { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
This property is ignored is PercentageSizing is enabled and the node column is marked to participate in the percentage sizing calculations.
AllowSort
Gets or sets whether clicking on column headers will sort the column.
Declaration
public bool AllowSort { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
AutoGenerateColumnsInfo
Gets or sets a value indicating whether to generate the CellType automatically
Declaration
public bool AutoGenerateColumnsInfo { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
AutoPopulateColumns
If AutoPopulateColumns is set to True, then visible column defined will be populated in the View. else all the columns in the itemsource will be populated in the view
Declaration
public bool AutoPopulateColumns { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ColumnHeaderStyle
Gets or sets a GridStyleInfo object that defines the style information for the column headers.
Declaration
public GridStyleInfo ColumnHeaderStyle { get; set; }
Property Value
| Type |
|---|
| GridStyleInfo |
Columns
A collection of the TreeColumns that control the number and order of the columns that appear in the Tree.
Declaration
public ObservableCollection<GridTreeColumn> Columns { get; set; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<GridTreeColumn> |
CustomVisualStyle
Gets or sets the custom visual style.
Declaration
public IGridTreeVisualStyle CustomVisualStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| IGridTreeVisualStyle | The custom visual style. |
EnableHotRowMarker
Gets or sets whether the row under the current mouse position is redrawn using the HotRowMarker as a background brush.
Declaration
public bool EnableHotRowMarker { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
EnableLegacyStyle
Declaration
public bool EnableLegacyStyle { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
EnableNodeSelection
Gets or sets whether your user can select whole row when a cell is clicked with the mouse.
Declaration
public bool EnableNodeSelection { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
Setting this property to true also sets GridTreeControl.Model.Options.ListBoxSelectionMode to MultiExtended. If you want the selected behavior to be something other than MultiExtended, you will need to explicitly set it after setting this property.
EnableSelections
Gets or sets whether your user can select whole row when a cell is clicked with the mouse.
Declaration
public bool EnableSelections { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
Setting this property to true also sets GridTreeControl.Model.Options.ListBoxSelectionMode to MultiExtended. If you want the selected behavior to be something other than MultiExtended, you will need to explicitly set it after setting this property.
ExpandGlyphType
Gets or sets the type of the glyph shown in the expand cell.
Declaration
public GridTreeExpandGlyph ExpandGlyphType { get; set; }
Property Value
| Type |
|---|
| GridTreeExpandGlyph |
Remarks
The default value is a triangle. You can also set a +- glyph, or a +-glyph with tree lines, or a custom drawn glyph. The property NodeColumnWidth reserves the required width of your glyph. The default value of NodeColumnWidth is 10 which is the setting used for the triangle glyph. For the +- glyph, the value of NodeColumnWidth is set to 14. If you want to explicitly provide a particular NodeColumnWidth, then you need to explicitly reset its value after you set ExpandGlyphType as setting ExpandGlypType also possibly resets NodeColumnWidth.
ExpandNewNodeOnCreation
Gets or sets a value indicating whether [expand new node on creation].
Declaration
public bool ExpandNewNodeOnCreation { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
ExpandStateAtStartUp
Gets or sets the expand states for nodes when the tree is initially displayed.
Declaration
public GridTreeStartUpExpandState ExpandStateAtStartUp { get; set; }
Property Value
| Type |
|---|
| GridTreeStartUpExpandState |
FreezeExpandColumn
Gets of sets whether the column with the expand/contract glymp is scrollable.
Declaration
public bool FreezeExpandColumn { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
HasDataSource
Gets whether root nodes have been set for this tree grid.
Declaration
public bool HasDataSource { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasUnboundColumns
Gets a value indicating whether this instance has unbound columns.
Declaration
public bool HasUnboundColumns { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
HideEmptyChildGlyphs
Gets or sets whether empty child nodes show the +/- cells when they are initially displayed.
Declaration
public bool HideEmptyChildGlyphs { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
Remarks
The default GridTreeControl raises the RequestTreeItem event for each child node as it becomes visible the first time so the GridTreeControl will not display the +/- for nodes that have no children. If you set this property to false, the GridTreeControl will not raise the RequestTreeItems for the child until the child node is clicked to be expanded. At that point, if the child node has no children, the +/- will go away.
InvalidateActionOnCellChange
Gets or sets what part of the grid is invalidated when a cell value changes.
Declaration
public InvalidateAction InvalidateActionOnCellChange { get; set; }
Property Value
| Type |
|---|
| InvalidateAction |
Remarks
This property only has an effect if NotifyPropertyChanges is true. The default value is InvalidateAction.Cell.
ItemProperties
Gets a PropertyDescriptorCollection describing the type of the underlying data item.
Declaration
public PropertyDescriptorCollection ItemProperties { get; }
Property Value
| Type |
|---|
| System.ComponentModel.PropertyDescriptorCollection |
ItemPropertyType
The underlying type of the object that holds the data for a tree node.
Declaration
public Type ItemPropertyType { get; set; }
Property Value
| Type |
|---|
| System.Type |
LevelStyles
Gets or sets a collection of GridStyleInfo objects that will be applied to specific levels.
Declaration
public List<GridStyleInfo> LevelStyles { get; set; }
Property Value
| Type |
|---|
| System.Collections.Generic.List<GridStyleInfo> |
LoadAllAtStartUp
Gets or sets whether your RequestTreeItems event will load the entire tree when it sees the rwuest for the root nodes.
Declaration
public bool LoadAllAtStartUp { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
MarkRowBrush
Brush used to draw the background of the row currently under the mouse location.
Declaration
public Brush MarkRowBrush { get; set; }
Property Value
| Type |
|---|
| System.Windows.Media.Brush |
NodeColumnWidth
Gets or sets the width of the expand glyph area.
Declaration
public double NodeColumnWidth { get; set; }
Property Value
| Type |
|---|
| System.Double |
Remarks
When the expand glyph is the triangle, this value is set to 10. When the expand glyph is a +-, this value is set to 14. If you want to explicitly provide a particular NodeColumnWidth, then you need to explicitly reset its value after you set ExpandGlyphType as setting ExpandGlypType also possibly resets NodeColumnWidth.
Nodes
Gets the list of GridNodes associated with the displayed tree.
Declaration
public List<GridTreeNode> Nodes { get; }
Property Value
| Type |
|---|
| System.Collections.Generic.List<GridTreeNode> |
Remarks
There is a one-one mapping between GridTreeNodes in the Nodes list and the rows in the GridControl possibly excluding the column header. Given a GridTreeNode, you can access the underlying data object for the row using node.Item property.
NotifyPropertyChanges
Gets of sets whether the column with the expand/contract glymp is scrollable.
Declaration
public bool NotifyPropertyChanges { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ParentTreeControl
Gets the GridTreeControl associated with this GridTreeControlImpl.
Declaration
public GridTreeControl ParentTreeControl { get; }
Property Value
| Type |
|---|
| GridTreeControl |
PercentSizingBehavior
Gets or sets the percentage sizing behavior in the GridTreeControl.
Declaration
public GridPercentColumnSizingBehavior PercentSizingBehavior { get; set; }
Property Value
| Type |
|---|
| GridPercentColumnSizingBehavior |
Remarks
Set the GridTreeColumn.PercentWidth property to enable a particular column to participate in the automatic sizing as the TreeGridControl client width changes. Depending upon the value of PercentSizingBehavior, the free client width left after all the columns whose PrecentWidth is not set has been subtracted, is proportionally allocated among all those columns whose PercentWidth is set.
ReadOnly
Gets or sets whether the TreeGrid is ReadOnly.
Declaration
public bool ReadOnly { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
RootNodes
Gets or sets the root node(s) for this tree grid.
Declaration
public List<GridTreeNode> RootNodes { get; set; }
Property Value
| Type |
|---|
| System.Collections.Generic.List<GridTreeNode> |
RowHeaderStyle
Gets or sets a GridStyleInfo object that is used to defined the row headers.
Declaration
public GridStyleInfo RowHeaderStyle { get; set; }
Property Value
| Type |
|---|
| GridStyleInfo |
RowHeaderWidth
Gets or sets the width of the row header column.
Declaration
public double RowHeaderWidth { get; set; }
Property Value
| Type |
|---|
| System.Double |
SelectedNodes
Gets a collection of the selected nodes within the GridTreeControl. This property is only valid when EnableNodeSelection is true.
Declaration
public GridSelectedTreeNodes SelectedNodes { get; }
Property Value
| Type |
|---|
| GridSelectedTreeNodes |
ShowColumnHeaders
Gets or sets whether a header row is visible
Declaration
public bool ShowColumnHeaders { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ShowExpandColumnBorders
Gets or sets whether the grid lines are seen in the expand column.
Declaration
public bool ShowExpandColumnBorders { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ShowRowHeader
Gets or sets whether a header column is visible
Declaration
public bool ShowRowHeader { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
SortComparer
Gets or sets the IComparer object used in the tree sorting.
Declaration
public IComparer<GridTreeNode> SortComparer { get; set; }
Property Value
| Type |
|---|
| System.Collections.Generic.IComparer<GridTreeNode> |
Remarks
The default implementation assumes the underlying node items implement IComparable and uses that implementation for the sorting comparisons within the columns. If your objects are not IComparable, then you need to provide a SortComparer that properly sorts the GridNodes depending upon the SortProperty value of GridNode.Item.
SortProperty
Gets or sets the property to be sorted.
Declaration
public string SortProperty { get; set; }
Property Value
| Type |
|---|
| System.String |
Remarks
This string holds the column name to be sorted. You can specify a SortDirection by appending a space followed by either ASC or DESC. In addition, you can specify multicolumn sorts by passing several columns separated by commas. For example, "Price ASC, Weight DESC" would indicate to first sort in ascending order by the Price column, and then sort in descending order by the Weight column.
SortStates
Gets or sets a list of the SortStates of currently sorted columns.
Declaration
public List<SortState> SortStates { get; set; }
Property Value
| Type |
|---|
| System.Collections.Generic.List<SortState> |
SupportNodeImages
Gets or sets whether an event is raised to request an image to be displayed for a node.
Declaration
public bool SupportNodeImages { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
SupportRowSizing
Gets or sets whether your user can size row heights with the mouse.
Declaration
public bool SupportRowSizing { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
SupportsVisualStyles
Gets or sets whether the GridTreeControlImpl should adjust its appearance according to the
Declaration
public bool SupportsVisualStyles { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
TrackSelectionOnCollectionChange
Gets or Sets whether to track the selection when the binded collection changed
Declaration
public bool TrackSelectionOnCollectionChange { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
TreeModel
Declaration
public GridTreeModel TreeModel { get; }
Property Value
| Type |
|---|
| Syncfusion.Windows.Controls.Grid.GridTreeModel |
UnboundRowPosition
Declaration
public Position UnboundRowPosition { get; set; }
Property Value
| Type |
|---|
| Position |
UnboundRowsCount
Declaration
public int UnboundRowsCount { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
VisualStyle
Gets or sets the visual style.
Declaration
public VisualStyle VisualStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| VisualStyle | The visual style. |
Methods
AutoPopulateColumnInfo()
This method is only called if the Columns collection has not been explicitly populated by the user before the initial raising of the RequestTreesItems event in OnLoad.
Declaration
public void AutoPopulateColumnInfo()
CancelEdit()
Declaration
public void CancelEdit()
CollapseAllNodes()
Collapses all expanded nodes.
Declaration
public void CollapseAllNodes()
CollapseAllNodes(GridTreeNode)
Collapse all passed-in node as well as child nodes of the passed-in node.
Declaration
public void CollapseAllNodes(GridTreeNode n)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTreeNode | n | The node to be collapsed. |
CollapseNode(GridTreeNode)
Collapses a single node.
Declaration
public void CollapseNode(GridTreeNode n)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTreeNode | n | The node to be collapsed. |
CollapseNode(GridTreeNode, Boolean)
Declaration
public void CollapseNode(GridTreeNode n, bool shouldMaintainSelection)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTreeNode | n | |
| System.Boolean | shouldMaintainSelection |
CollapseNode(Int32)
Collapse the GridNode that corresponds to the given grid row index.
Declaration
public void CollapseNode(int gridRowIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | gridRowIndex | The rowIndex of the GridNode to be collapsed. |
ColumnIndexToName(Int32)
Returns the Column.MappingName for the column whose grid ColumnIndex is given.
Declaration
public string ColumnIndexToName(int gridColumnIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | gridColumnIndex | The grid ColumnIndex. |
Returns
| Type | Description |
|---|---|
| System.String | The MappingName. |
ColumnIndexToPosition(Int32)
Returns the position in the Columns collection for the given grid column index.
Declaration
public int ColumnIndexToPosition(int gridColumnIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | gridColumnIndex | The grid column index. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The position in the Columns collection. |
ColumnNameToPosition(String)
Returns the position in the Columns collection for the given column name.
Declaration
public int ColumnNameToPosition(string columnName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | columnName | The column name. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The position in the Columns collection. |
Deserialize(String)
Deserializes the specified GridTreeControlImpl.
Declaration
public void Deserialize(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fileName |
DeserializeFromStream(TextReader)
Deserializes from stream.
Declaration
public void DeserializeFromStream(TextReader textReader)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.TextReader | textReader | The text reader. |
DeserializeFromString(String)
Deserializes GridTreeControlImpl properties from string.
Declaration
public void DeserializeFromString(string content)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | content | The content. |
Dispose(Boolean)
Declaration
public override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
Overrides
DoLoad()
Declaration
public void DoLoad()
ExpandAllNodes()
Expand all nodes.
Declaration
public void ExpandAllNodes()
ExpandAllNodes(GridTreeNode)
Expands the given node and all of its child nodes.
Declaration
public void ExpandAllNodes(GridTreeNode n)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTreeNode | n | The node to be expanded. |
ExpandNode(GridTreeNode)
Expands the single node.
Declaration
public void ExpandNode(GridTreeNode n)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTreeNode | n | The node to be expanded. |
ExpandNode(Int32)
Expand the GridNode that corresponds to the given grid row index.
Declaration
public void ExpandNode(int gridRowIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | gridRowIndex | The rowIndex of the GridNode to be expanded. |
FindPropertyNameInStates(String)
Returns the index of the property name in the SortStates collection
Declaration
public int FindPropertyNameInStates(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The property name. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The index. |
GetGridRowType(Int32)
Declaration
public GridTreeRowType GetGridRowType(int gridRowIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | gridRowIndex |
Returns
| Type |
|---|
| GridTreeRowType |
GetNodeAtRowIndex(Int32)
Gets the Node at the specified grid row index.
Declaration
public GridTreeNode GetNodeAtRowIndex(int gridRowIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | gridRowIndex | The grid row index. |
Returns
| Type | Description |
|---|---|
| GridTreeNode | The Node at the specified grid row index. |
GetRecordsIndexFromItem(Object)
Declaration
public int GetRecordsIndexFromItem(object item)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | item |
Returns
| Type |
|---|
| System.Int32 |
GetRecordsIndexFromRowIndex(Int32)
Declaration
public int GetRecordsIndexFromRowIndex(int rowindex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowindex |
Returns
| Type |
|---|
| System.Int32 |
GetRowIndexFromItem(Object)
Declaration
public int GetRowIndexFromItem(object item)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | item |
Returns
| Type |
|---|
| System.Int32 |
GetRowIndexFromNode(GridTreeNode)
Declaration
public int GetRowIndexFromNode(GridTreeNode n)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTreeNode | n |
Returns
| Type |
|---|
| System.Int32 |
GetTreeNodeOfRecord(Object)
To Find the node in which we have to add new node or delete old node
Declaration
public GridTreeNode GetTreeNodeOfRecord(object record)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | record |
Returns
| Type |
|---|
| GridTreeNode |
GetUnboundColumnValue(Object, GridTreeUnboundColumn)
Declaration
public object GetUnboundColumnValue(object record, GridTreeUnboundColumn column)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | record | |
| GridTreeUnboundColumn | column |
Returns
| Type |
|---|
| System.Object |
GetValueFromNode(String, GridTreeNode)
Gets the value of a particular column in a GridTreeNode.
Declaration
public object GetValueFromNode(string propertyName, GridTreeNode node)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | propertyName | The column name. |
| GridTreeNode | node | The GridTreeNode. |
Returns
| Type | Description |
|---|---|
| System.Object | The value. |
GetVisibleColumns()
This Method used to Get the TotalColumns in the Collection.
Declaration
public List<GridTreeColumn> GetVisibleColumns()
Returns
| Type |
|---|
| System.Collections.Generic.List<GridTreeColumn> |
InitializeTreeModel(GridTreeModel)
Declaration
protected virtual void InitializeTreeModel(GridTreeModel model)
Parameters
| Type | Name | Description |
|---|---|---|
| Syncfusion.Windows.Controls.Grid.GridTreeModel | model |
IsPropertySorted(String, out SortState)
Declaration
public bool IsPropertySorted(string propertyName, out SortState state)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | propertyName | |
| SortState | state |
Returns
| Type |
|---|
| System.Boolean |
OnCreatingTreeNode(Int32, Object, Boolean, GridTreeNode)
Raises the CreatingTreeNode event.
Declaration
protected virtual GridTreeNode OnCreatingTreeNode(int level, object item, bool expanded, GridTreeNode parentNode)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | level | The level of the new node. |
| System.Object | item | The underlying data item for the new node. |
| System.Boolean | expanded | Whether the new node is initially expanded. |
| GridTreeNode | parentNode | The parent node of this new node. |
Returns
| Type |
|---|
| GridTreeNode |
OnCurrentCellRejectedChanges(SyncfusionRoutedEventArgs)
Declaration
protected override void OnCurrentCellRejectedChanges(SyncfusionRoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| SyncfusionRoutedEventArgs | e |
Overrides
OnCurrentCellStartEditing(SyncfusionCancelRoutedEventArgs)
Declaration
protected override void OnCurrentCellStartEditing(SyncfusionCancelRoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| SyncfusionCancelRoutedEventArgs | e |
Overrides
OnExpandStateChanged(GridTreeNode, GridTreeNodeActions)
Raises the ExpandStateChanged event.
Declaration
protected void OnExpandStateChanged(GridTreeNode node, GridTreeNodeActions action)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTreeNode | node | The node that was clicked. |
| GridTreeNodeActions | action | The action that was taken. |
OnExpandStateChanging(GridTreeNode, GridTreeNodeActions)
Raises the ExpandStateChanging event.
Declaration
protected bool OnExpandStateChanging(GridTreeNode node, GridTreeNodeActions action)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTreeNode | node | The node that was clicked. |
| GridTreeNodeActions | action | The action to be taken. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the action should be completed, false otherwise. |
OnItemPropertychanged(Object, PropertyChangedEventArgs)
Declaration
protected virtual void OnItemPropertychanged(object sender, PropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | |
| System.ComponentModel.PropertyChangedEventArgs | e |
OnLoaded(RoutedEventArgs)
This method is overridden to trigger the initial loading of the root items. It does this by raising the RequestTreeItems event and passing null for the ParentItem in teh event arguments class.
Declaration
protected override void OnLoaded(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.RoutedEventArgs | e | The routed event arguments. |
Overrides
OnQueryUnknownProperty(GridTreeNode, String)
Raises the QueryUnknownProperty event.
Declaration
protected virtual object OnQueryUnknownProperty(GridTreeNode node, string propertyName)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTreeNode | node | The node whose property is being requested. |
| System.String | propertyName | The requested property name. |
Returns
| Type | Description |
|---|---|
| System.Object | The requested value. |
OnRenderBorder(DrawingContext, Rect, Rect, CellBorderSide, Pen)
Declaration
protected override void OnRenderBorder(DrawingContext dc, Rect cellRect, Rect clipRect, CellBorderSide borderSide, Pen pen)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Media.DrawingContext | dc | |
| System.Windows.Rect | cellRect | |
| System.Windows.Rect | clipRect | |
| CellBorderSide | borderSide | |
| System.Windows.Media.Pen | pen |
Overrides
OnRequestNodeImage(GridTreeRequestNodeImageEventArgs)
Raises the RequestTreeItems event.
Declaration
public virtual void OnRequestNodeImage(GridTreeRequestNodeImageEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTreeRequestNodeImageEventArgs | e | The event arguments. |
OnResizingColumns(GridResizingColumnsEventArgs)
Declaration
protected override void OnResizingColumns(GridResizingColumnsEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| GridResizingColumnsEventArgs | args |
Overrides
PopulateGridNodes(Boolean)
Used internally. Called to populate all open nodes in a tree.
Declaration
public void PopulateGridNodes(bool forceRepopulate)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | forceRepopulate | True if you want the child lists to be reloaded. |
Remarks
This method is called initally as the tree is first loaded, and then after sorts are done to redisplay the tree contents in a possible new order.
PopulateGridNodes(Boolean, Boolean)
Declaration
public void PopulateGridNodes(bool forceRepopulate, bool ignoreColWidths)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | forceRepopulate | |
| System.Boolean | ignoreColWidths |
PopulateTree()
This method is called from OnLoad to initially populate the tree grid.
Declaration
public void PopulateTree()
PositionToColumnIndex(Int32)
Returns the grid column index for the given position.
Declaration
public int PositionToColumnIndex(int position)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | position | An valid inndex of the Columns collection. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The column index in the grid, and a -1 if the position is invalid. |
PropertyNameFromColumnIndex(Int32)
Gets the property name for the given column index.
Declaration
public string PropertyNameFromColumnIndex(int columnIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | columnIndex | The column index. |
Returns
| Type | Description |
|---|---|
| System.String | The name of the property appearing in this column. |
QueryWantsMouseInput(MouseDevice)
Declaration
protected virtual bool QueryWantsMouseInput(MouseDevice mouseDevice)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseDevice | mouseDevice |
Returns
| Type |
|---|
| System.Boolean |
ReloadNode(GridTreeNode)
Used internally. To add Particular node.
Declaration
public void ReloadNode(GridTreeNode node)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTreeNode | node |
RenderSelectedCells()
Declaration
protected override void RenderSelectedCells()
Overrides
ResetDisplay()
Forces the whole tree to redraw itself.
Declaration
public void ResetDisplay()
ResetDisplay(Int32)
Forces the whole grid to redraw itself with row heights being reset from given grid rowindex.
Declaration
public void ResetDisplay(int startRow)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | startRow | The grid rowindex from where the redrawing should take place. |
ResetGrid()
Ensures the grid properly reflects the rows and columns in the current expanded nodes.
Declaration
public void ResetGrid()
ResetGrid(Int32)
Resets the contents of the tree starting at the passed in grid row index. Ensures the grid properly reflects the rows and columns in the current expanded nodes.
Declaration
public void ResetGrid(int startRow)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | startRow | The start row from which the grid is refreshed. |
ResolveIndexToColumnIndex(Int32)
Declaration
public int ResolveIndexToColumnIndex(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index |
Returns
| Type |
|---|
| System.Int32 |
ResolveIndexToUnboundRowPosition(Int32)
Declaration
public int ResolveIndexToUnboundRowPosition(int rowindex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowindex |
Returns
| Type |
|---|
| System.Int32 |
Serialize(String)
Serializes the specified properties in the GridTreeControlImpl.
Declaration
public void Serialize(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fileName |
SerializeAsString()
Serializes the GridTreeControlImpl properties as string.
Declaration
public string SerializeAsString()
Returns
| Type |
|---|
| System.String |
SerializeToStream(TextWriter)
Serializes to stream.
Declaration
public void SerializeToStream(TextWriter textWriter)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.TextWriter | textWriter | The text writer. |
SetExpandBrushesAndPen(Brush, Brush, Pen)
Sets the brushes and pen used in drawing the glyph in the expand cell.
Declaration
public void SetExpandBrushesAndPen(Brush expandWidgetBrush, Brush hotExpandWidgetBrush, Pen expandWidgetPen)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Media.Brush | expandWidgetBrush | The Brush for drawing the interior of the normal glyph. |
| System.Windows.Media.Brush | hotExpandWidgetBrush | The Brush for drawing the interior of the glyph when teh mouse is over it. |
| System.Windows.Media.Pen | expandWidgetPen | The Pen for drawing the glyph border. |
SortAfterEdit(Int32, Int32)
This method sort the GridTreeControl After Edit the values in the cell
Declaration
public void SortAfterEdit(int rowIdx, int colIdx)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIdx | |
| System.Int32 | colIdx |
SortTree(String, ListSortDirection)
Sorts the tree contents within tree levels.
Declaration
public void SortTree(string colName, ListSortDirection direction)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | colName | The name of the column to be sorted. |
| System.ComponentModel.ListSortDirection | direction | The direction of the sort. |
SortTree(String, ListSortDirection, Boolean)
Sorts the tree contents within tree levels.
Declaration
public void SortTree(string colName, ListSortDirection direction, bool clearSort)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | colName | The name of the column to be sorted. |
| System.ComponentModel.ListSortDirection | direction | The direction of the sort. |
| System.Boolean | clearSort | Whether any existing sort should be cleared before the new sort is applied. |
Events
ExpandStateChanged
A notification event that is raised after a node has been expand or collapsed as the result of the user clicking the expand button.
Declaration
public event GridTreeNodeEventHandler ExpandStateChanged
Event Type
| Type |
|---|
| GridTreeNodeEventHandler |
ExpandStateChanging
A cancelable event raised before the expand state of a node changes as a result of the user clicking the expand button.
Declaration
public event GridTreeNodeCancelEventHandler ExpandStateChanging
Event Type
| Type |
|---|
| GridTreeNodeCancelEventHandler |
QueryUnboundCellInfo
Declaration
public event GridTreeQueryUnboundCellInfoEventHandler QueryUnboundCellInfo
Event Type
| Type |
|---|
| GridTreeQueryUnboundCellInfoEventHandler |
QueryUnboundColumnValue
Declaration
public event GridTreeQueryUnboundColumnEventHandler QueryUnboundColumnValue
Event Type
| Type |
|---|
| GridTreeQueryUnboundColumnEventHandler |
QueryUnknownProperty
Event raised whenever a value for an unknown property is required.
Declaration
public event GridTreeQueryUnknownPropertyHandler QueryUnknownProperty
Event Type
| Type |
|---|
| GridTreeQueryUnknownPropertyHandler |
RequestNodeImage
This event is used to request a node image for a particular node item.
Declaration
[Obsolete("Not sure if needed")]
public event GridTreeRequestNodeImageHandler RequestNodeImage
Event Type
| Type |
|---|
| GridTreeRequestNodeImageHandler |
Remarks
To see images next to the expand glyph, subscribe to this event and provide the image needed for the node item passed in the event argument.
RequestTreeItems
This event is used to request an IEnumerable object that holds the child item objects for a particular parent item.
Declaration
public event GridTreeRequestTreeItemsHandler RequestTreeItems
Event Type
| Type |
|---|
| GridTreeRequestTreeItemsHandler |
Remarks
In order to see data displayed in the TreeGrid, you must handle this event. The events args pass in a parent object, and your event handler needs to provide an IEnumerable object that contains teh childs objects for this pareent object. If the parent object is null, you should provide the collection of root objects for the tree.
Explicit Interface Implementations
ISupportsRecordSelection<GridTreeNode>.EnableNodeSelection
Declaration
bool ISupportsRecordSelection<GridTreeNode>.EnableNodeSelection { get; set; }
Returns
| Type |
|---|
| System.Boolean |
ISupportsRecordSelection<GridTreeNode>.GetNodeAtRowIndex(Int32)
Declaration
GridTreeNode ISupportsRecordSelection<GridTreeNode>.GetNodeAtRowIndex(int gridRowIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | gridRowIndex |
Returns
| Type |
|---|
| GridTreeNode |
ISupportsRecordSelection<GridTreeNode>.GetRowIndexFromItem(Object)
Declaration
int ISupportsRecordSelection<GridTreeNode>.GetRowIndexFromItem(object item)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | item |
Returns
| Type |
|---|
| System.Int32 |
ISupportsRecordSelection<GridTreeNode>.SelectedNodes
Declaration
GridSelectedObjectsBase<GridTreeNode> ISupportsRecordSelection<GridTreeNode>.SelectedNodes { get; }
Returns
| Type |
|---|
| GridSelectedObjectsBase<GridTreeNode> |