Hi
I have a problem where the RowSelected event does not fire when I click on a row in the Grid.
However when I click sort then the OnActionComplete does fire.
This is the Grid:
<SfGrid @ref="PeopleGrid" DataSource="@PeopleList" Height="800" Width="Auto" AllowSorting="true" SelectedRowIndex="@SelectedRow" AllowSelection="true" EnableHover="true">
<GridEvents OnActionComplete="RowSelectHandler2" RowSelected="RowSelectHandler" TValue="PersonModel"></GridEvents>
<GridPageSettings PageSize="5"></GridPageSettings>
<GridColumns>
<GridColumn Field=@nameof(PersonModel.FirstName) HeaderText="First Name" Width="64"></GridColumn>
<GridColumn Field=@nameof(PersonModel.LastName) HeaderText="Last Name" Width="64"></GridColumn>
<GridColumn Field=@nameof(PersonModel.Sex) HeaderText="Sex" Width="32"></GridColumn>
<GridColumn HeaderText="Civil Status" Width="64">
<Template>
@{
var person = (context as PersonModel);
if (person.CivilStatuses[0].Status == Status.Single)
{
<div>@person.CivilStatuses[0].Status.ToString()</div>
}
else
{
if (person.CivilStatuses[0].Name.Length == 0)
{
<div>@person.CivilStatuses[0].Status.ToString()</div>
}
else
{
<div>@person.CivilStatuses[0].Name</div>
}
}
}
</Template>
</GridColumn>
<GridColumn Field=@nameof(PersonModel.BirthDay) HeaderText="Birthday" EditType="EditType.DatePickerEdit" Format="d" Type="ColumnType.Date" Width="64"></GridColumn>
</GridColumns>
</SfGrid>
And the is the two functions being called: (Where RowSelectHandler2 is fired and RowSelectHandler is not)
public void RowSelectHandler2(ActionEventArgs<PersonModel> args)
{
SetSelectedPerson(SelectedRow + 1);
}
public void RowSelectHandler(RowSelectEventArgs<PersonModel> args)
{
SetSelectedPerson(SelectedRow + 1);
}