windowsforms-devexpress-dot-xtratreelist-dot-treelist-dot-getdatarecordbynode-x28-devexpress-dot-xtratreelist-dot-nodes-dot-treelistnode-x29.md
Returns a data row associated with the node specified.
Namespace : DevExpress.XtraTreeList
Assembly : DevExpress.XtraTreeList.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList
public virtual object GetDataRecordByNode(
TreeListNode node
)
Public Overridable Function GetDataRecordByNode(
node As TreeListNode
) As Object
| Name | Type | Description |
|---|---|---|
| node | TreeListNode |
The TreeListNode object representing the node whose associated data row is to be obtained.
|
| Type | Description |
|---|---|
| Object |
A data row associated with the node specified. null ( Nothing in Visual Basic) if the node is not found.
|
If the Tree List is bound to a data source, the GetDataRecordByNode method returns the data row associated with the specified node. When working in unbound mode, an array of cell values that reside within the specified node is returned.
The following code snippets (auto-collected from DevExpress Examples) contain references to the GetDataRecordByNode(TreeListNode) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
private void Tree_CustomColumnDisplayText(object sender, CustomColumnDisplayTextEventArgs e) {
var row = tree.GetDataRecordByNode(e.Node) as DashboardFlatDataSourceRow;
e.DisplayText = flatData.GetDisplayText(e.Column.FieldName, row);
winforms-richeditcontrol-common-api/CS/RichEditAPISample/Form1.cs#L463
void OnNewExampleSelected(object sender, FocusedNodeChangedEventArgs e) {
CodeExample newExample = (sender as TreeList).GetDataRecordByNode(e.Node) as CodeExample;
CodeExample oldExample = (sender as TreeList).GetDataRecordByNode(e.OldNode) as CodeExample;
word-document-api-examples/CS/Form1.cs#L85
treeList1.FocusedNode = treeList1.MoveFirst().FirstNode;
RichEditExample example = treeList1.GetDataRecordByNode(treeList1.FocusedNode) as RichEditExample;
codeEditor.ShowExample(example);
winforms-tokenedit-dropdown-with-treelist/CS/TokenEditTest/CustomTokenEditDropDownControl.cs#L78
}
object GetSelectedDataItem() { return this.selNode != null ? TreeList.GetDataRecordByNode(this.selNode) : null; }
void OnTreeListVirtualTreeGetChildNodes(object sender, VirtualTreeGetChildNodesInfo e) {
excel-export-api-examples/CS/XLExportExamples/Form1.cs#L144
{
SpreadsheetExample example = treeList1.GetDataRecordByNode(treeList1.FocusedNode) as SpreadsheetExample;
if (example == null)
Private Sub Tree_CustomColumnDisplayText(ByVal sender As Object, ByVal e As CustomColumnDisplayTextEventArgs)
Dim row = TryCast(tree.GetDataRecordByNode(e.Node), DashboardFlatDataSourceRow)
e.DisplayText = flatData.GetDisplayText(e.Column.FieldName, row)
winforms-richeditcontrol-common-api/VB/RichEditAPISample/Form1.vb#L459
Private Sub OnNewExampleSelected(ByVal sender As Object, ByVal e As FocusedNodeChangedEventArgs)
Dim newExample As CodeExample = TryCast((TryCast(sender, TreeList)).GetDataRecordByNode(e.Node), CodeExample)
Dim oldExample As CodeExample = TryCast((TryCast(sender, TreeList)).GetDataRecordByNode(e.OldNode), CodeExample)
word-document-api-examples/VB/Form1.vb#L81
If treeList1.Nodes.Count > 0 Then treeList1.FocusedNode = treeList1.MoveFirst().FirstNode
Dim example As RichEditExample = TryCast(treeList1.GetDataRecordByNode(treeList1.FocusedNode), RichEditExample)
codeEditor.ShowExample(example)
winforms-tokenedit-dropdown-with-treelist/VB/TokenEditTest/CustomTokenEditDropDownControl.vb#L87
Private Function GetSelectedDataItem() As Object
Return If(Me.selNode IsNot Nothing, TreeList.GetDataRecordByNode(Me.selNode), Nothing)
End Function
excel-export-api-examples/VB/XLExportExamples/Form1.vb#L143
Private Sub RunExample(ByVal filePath As String, ByVal documentFormat As XlDocumentFormat)
Dim example As SpreadsheetExample = TryCast(treeList1.GetDataRecordByNode(treeList1.FocusedNode), SpreadsheetExample)
If example Is Nothing Then
See Also