DxTreeList.GetRowValue(Int32, String) Method
Returns the value of the data source field in the specified row.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.1.dll
NuGet Package: DevExpress.Blazor
Declaration
public object GetRowValue(
int visibleIndex,
string fieldName
)
Parameters
Name | Type | Description |
---|---|---|
visibleIndex | Int32 | The row’s visible index. |
fieldName | 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 TreeList is bound to the GridDevExtremeDataSource or loads data on demand, call the WaitForRemoteSourceRowLoadAsync(Int32) method before you execute the GetRowValue
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