We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Highlight row selected when using RowSelectedEvent

Hi,


When using RowSelected event the selected row is not highlighted.


I know that there is already a same issue logged but I didn't see any follow up, I have the same issue and was wondering if there is a workaround or when it will be fixed.


I am using syncfusion 21.1.39.


Thanks.


3 Replies

SP Sarveswaran Palani Syncfusion Team April 18, 2023 03:30 AM UTC

Hi Alexandre,

Greetings from Syncfusion support.

Based on your query, we would like to inform you that RowSelected event triggers when row is selected. This is the default behavior of the event. We have attached sample and video demo for your reference. If we misunderstood your query, kindly share an issue reproducible sample or reproduce the reported issue in the provided sample and share video demo of an issue replication. It’ll be helpful for further evaluate your query and provide solution ASAP from our end.

Regards,
Sarvesh



Attachment: SfGridRowSelected_c93a33d3.zip


AP Alexandre Pereira April 19, 2023 01:39 AM UTC

The event is triggered, but the row loses the highlight.


Similar to this issue:  Selected row loses highlight when RowSelected event is used | Blazor Forums | Syncfusion


```


@using Csc.Reports.Blazor.Utils
@using Csc.Reports.Reports.BookingChange
@using Csc.Reports.Blazor.Models.BookingChanges
@using SelectionMode=Syncfusion.Blazor.Grids.SelectionMode
@using SelectionType=Syncfusion.Blazor.Grids.SelectionType

<SfGrid TValue="CustomerStatsDto"
ContextMenuItems="GridSettings.ContextMenuItems"
FilterSettings="GridSettings.FilterSettings"
RowHeight="GridSettings.RowHeight"
Toolbar="GridSettings.Toolbar"
AllowSorting="GridSettings.AllowSorting"
AllowPaging="GridSettings.AllowPaging"
AllowFiltering="GridSettings.AllowFiltering"
AllowMultiSorting="GridSettings.AllowMultiSorting"
AllowGrouping="true"
AllowResizing="GridSettings.AllowResizing"
AllowReordering="GridSettings.AllowReordering"
ShowColumnChooser="GridSettings.ShowColumnChooser"
EnableHover="GridSettings.EnableHover"
EnablePersistence="GridSettings.EnablePersistence"
EnableStickyHeader="GridSettings.EnableStickyHeader"
AllowTextWrap="true"
AllowSelection="true"
DataSource="CustomersStatsData">
<GridEvents RowSelected="HandleRowSelected"
TValue="CustomerStatsDto" />
<GridTextWrapSettings WrapMode="WrapMode.Header"/>
<GridPageSettings PageSizes="true"
PageSize="5">
</GridPageSettings>
<GridColumns>
<GridColumn Field="@nameof(CustomerStatsDto.CustomerId)"
HeaderText="Customer ID"
AutoFit="true"
Visible="true"
AllowGrouping="false"/>
<GridColumn Field="@nameof(CustomerStatsDto.CustomerName)"
HeaderText="Customer"
Visible="true"
AllowGrouping="false"/>
<GridColumn Field="@nameof(CustomerStatsDto.Suburb)"
HeaderText="Suburb"
Visible="false"/>
<GridColumn Field="@nameof(CustomerStatsDto.PlantId)"
HeaderText="Plant ID"
Visible="false"/>
<GridColumn Field="@nameof(CustomerStatsDto.PlantName)"
HeaderText="Plant"
Visible="false"/>
<GridColumn Field="@nameof(CustomerStatsDto.Volume)"
HeaderText="Volume"
Visible="true"
AllowFiltering="false"
Format="N2"
AllowGrouping="false"/>
<GridColumn Field="@nameof(CustomerStatsDto.VolumeDeviation)"
HeaderText="Volume Deviation"
Visible="true"
AllowFiltering="false"
Format="N2"
AllowGrouping="false"/>
<GridColumn Field="@nameof(CustomerStatsDto.VolumeDeviationPercent)"
HeaderText="Volume Deviation (%)"
AllowFiltering="false"
Visible="true"
Format="N2"
AllowGrouping="false"/>
<GridColumn Field="@nameof(CustomerStatsDto.ConfirmedWorkPercent)"
HeaderText="Confirmed Work (%)"
AllowFiltering="false"
Visible="true"
Format="N2"
AllowGrouping="false"/>
<GridColumn Field="@nameof(CustomerStatsDto.LaterThanPlanned)"
HeaderText="Later Than Planned"
Visible="true"
AllowFiltering="false"
Format="N1"
AllowGrouping="false"/>
<GridColumn Field="@nameof(CustomerStatsDto.AverageMinOnSite)"
HeaderText="Avg OnSite Time (min)"
AllowFiltering="false"
Visible="true"
Format="N1"
AllowGrouping="false"/>
<GridColumn Field="@nameof(CustomerStatsDto.VarianceDelivery)"
HeaderText="Variance / Delivery"
AllowFiltering="false"
Visible="true"
Format="N2"
AllowGrouping="false"/>
</GridColumns>
</SfGrid>

@code {

[EditorRequired]
[Parameter]
public IEnumerable<CustomerStatsDto> CustomersStatsData { get; set; } = Enumerable.Empty<CustomerStatsDto>();

[EditorRequired]
[Parameter]
public EventCallback<ValueTuple<string, string>> OnRowSelected { get; set; }

private Task HandleRowSelected(RowSelectEventArgs<CustomerStatsDto> arg)
{
var customer = (arg.Data.CustomerId, arg.Data.CustomerName);
return OnRowSelected.InvokeAsync(customer);
}
}


```



SP Sarveswaran Palani Syncfusion Team April 20, 2023 04:13 AM UTC

Hi Alexandre,

Before proceeding further with your requirement kindly share the below details to validate further at our end.


  1. Are you performing any operations in RowSelected event?
  2. What are the properties enabled in GridSelectionSettings?
  3. Share screenshot or video demo of an issue.
  4. Share code snippet or simple issue reproducible runnable sample to us.
  5. We would like to know more about the issue in detail. 


The above requested details will be helpful to validate further at our end and provide solution as earlier as possible.

Regards,
Sarvesh



Loader.
Live Chat Icon For mobile
Up arrow icon