DxTreeListColumn.VisibleChanged Event
In This Article
Fires when column visibility changes.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
#Declaration
C#
[Parameter]
public EventCallback<bool> VisibleChanged { get; set; }
#Parameters
Type | Description |
---|---|
Boolean | A new Visible property value. |
#Remarks
The VisibleChanged
event fires each time the Visible property value changes. The event is handled automatically when you use two-way data binding for the Visible
property (@bind-Visible
).
@inject EmployeeTaskService EmployeeTaskService
<style>
.column-chooser-button{
width: 200px;
}
</style>
<DxButton Text="Column Chooser"
RenderStyle="ButtonRenderStyle.Secondary"
CssClass="column-chooser-button"
Click="OnClick" />
<p />
<DxTreeList @ref="TreeList" Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId">
<Columns>
<DxTreeListDataColumn FieldName="Name" Caption="Task" />
<DxTreeListDataColumn FieldName="EmployeeName" />
<DxTreeListDataColumn FieldName="StartDate" @bind-Visible="Visible" />
<DxTreeListDataColumn FieldName="DueDate" />
</Columns>
</DxTreeList>
<p>The TemperartureF column's <b>Visible</b> property value is <b>@Visible</b></p>
@code {
DxTreeList TreeList { get; set; }
bool Visible { get; set; } = false;
List<EmployeeTask> TreeListData { get; set; }
protected override void OnInitialized() {
TreeListData = EmployeeTaskService.GenerateData();
}
void OnClick() {
TreeList.ShowColumnChooser(".column-chooser-button");
}
}
See Also