BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi,
Please advice
I want to adjus the column header of the ascending or descending order of data in terms of:
Font & font color
Thank you
Ragy
Hi AFICO ,
Greeting from Syncfusion support.
We understand that you're trying to adjust the column header of the ascending or descending order of data in terms of: Font & font color. So we suggest you to use the below highlighted codes at your end .
<SfGrid DataSource="@Orders" AllowSorting="true" Height="270"> <GridEvents OnActionBegin="ActionBeginHandler" TValue="Order"></GridEvents> <HeaderTemplate> @if (flag) { <div> <span style="color:red"> Emp ID</span> </div> } else if(flagdes) { <div> <span style="color:chartreuse"> Emp ID</span> </div> } else { <div> <span> Emp ID</span> </div> } </HeaderTemplate> <SfGrid>
@code { public void ActionBeginHandler(ActionEventArgs<Order> args) { if (args.RequestType == Syncfusion.Blazor.Grids.Action.Sorting) { if (args.Direction == Syncfusion.Blazor.Grids.SortDirection.Ascending) { flag = true; } else if (args.Direction == Syncfusion.Blazor.Grids.SortDirection.Descending) { flagdes = true; flag = false; } }
} } |
We have also included an sample as per your requirement. Kindly check the below attached sample and code snippet for your reference.
Please get back to us if you have further queries.
Regards,
Bala.
Hi AFICO,
Welcome,
Please get back to us if you need further assistance.
Regards,
Naveen Palanivel
If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.