Hello Team, i have a problem. I want to change the parameter GroupBy on a ListView, the thing is i want to change it dynamically when i click on a button, but it doesn't work.
When the component is initialized i set the parameter to one of the properties of the class, and it works, the listview is grouped. But when i click the button and i change the value of the parameter to another property, it does nothing, there is no visual change.
This is my code, i know that some parts are missing and got some hard-coded, but its just to make the group to work:
<SfListView @ref="listView" TValue="Email" DataSource="@emails">
<ListViewFieldSettings Id="email_id" Text="asunto" GroupBy="@agrupacion"></ListViewFieldSettings></SfListView>
<SfButton OnClick="Change">Change Group</SfButton>
public class Email
{
public int email_id { get; set; }
public string de { get; set; }
public string para { get; set; }
public string asunto { get; set; }
public string cuerpo { get; set; }
public DateTime fecha_recepcion { get; set; }}public string agrupacion { get; set; }private List<Email> emails { get; set; }private SfListView<Email> listView { get; set; }
private void
Change()
{
agrupacion = "fecha_recepcion";
}protected override async Task OnInitializedAsync()
{
agrupacion
= "para";
}Thank you for your time and i hope you can help me.