Hi Jose,
Thanks for contacting Syncfusion Forums.
Query: How hide row based on a condition?
You can customize the appearance of a row by using the RowDataBound event. The RowDataBound event triggers for every row. In the event handler, you can get the RowDataBoundEventArgs that contains details of the row. From args.Data you can get the row’s data and based on the row data, you can add class name to the row (args.Row) using “AddClass” method and you can set style “display” as “none” to the specific rows and hide them.
Please check the below code snippet,
<SfTreeGrid @ref="TreeGrid" DataSource="TreeData" IdMapping="TaskId" ParentIdMapping="ParentId" Height="315" TreeColumnIndex="1" >
<TreeGridEvents RowDataBound="OnRowDataBound" Value="WrapData"></TreeGridEvents>
</SfTreeGrid>
public void OnRowDataBound(RowDataBoundEventArgs<WrapData> args)
{
if(args.Data.Priority == "Normal"){ //checking condition
args.Row.AddClass(new string[] { "hide" }); //adding class name to row
}
}
<style>
.hide{
display: none;
}
</style>
|
Please check the below help documentation,
Kindly get back to us for further assistance.
Regards,
Padmavathy Kamalanathan