DxTreeList.GetRowValue(Int32, String) Method
In This Article
Returns the value of the data source field in the specified row.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
#Declaration
C#
public object GetRowValue(
int visibleIndex,
string fieldName
)
#Parameters
Name | Type | Description |
---|---|---|
visible |
Int32 | The row’s visible index. |
field |
String | The name of the data source field. |
#Returns
Type | Description |
---|---|
Object | The data object contained within the specified data source field. |
#Remarks
Note
When the TreeGet
method to ensure that the specified data row is loaded.
The following example displays information about the first visible row:
@inject EmployeeTaskService EmployeeTaskService
<style>
.my-button {
width: 200px;
}
</style>
<DxTreeList @ref="@MyTreeList" Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId">
<Columns>
<DxTreeListDataColumn FieldName="Name" Caption="Task" />
<DxTreeListDataColumn FieldName="EmployeeName" />
<DxTreeListDataColumn FieldName="StartDate" />
<DxTreeListDataColumn FieldName="DueDate" />
</Columns>
</DxTreeList>
<DxButton Click="@OnClick" CssClass="my-button" Text="Get the First Task" />
<p></p>
Task Name: @RowValue
@code {
ITreeList MyTreeList { get; set; }
object RowValue { get; set; }
List<EmployeeTask> TreeListData { get; set; }
protected override void OnInitialized() {
TreeListData = EmployeeTaskService.GenerateData();
}
void OnClick() {
RowValue = MyTreeList.GetRowValue(0, "Name");
}
}
See Also