SelectedItemsChanged not firing when checkbox is unselected.

1 Answer 54 Views
Grid
Bob
Top achievements
Rank 1
Iron
Veteran
Iron
Bob asked on 18 Aug 2021, 07:00 PM

I have a grid using checkbox selection and when I un-check a row, it is not firing the SelectedItemsChanged event.

The event adds filters to another grid I have on the page.

<TelerikGrid Data="strategicLevelItems" SelectedItems="selectedStrategic" Width="100%" Height="500px"
                                 ScrollMode="GridScrollMode.Scrollable" SelectionMode="GridSelectionMode.Multiple"
                                 SelectedItemsChanged="@((IEnumerable<GetNavigationNodesModel> strategicItems) => OnStrategicSelectAsync(strategicItems))"
                                 FilterMode="GridFilterMode.FilterRow">
                        <GridColumns>
                            <GridCheckboxColumn SelectAll="true" Width="40px" OnCellRender="@GridHelpers.CenterAlign" />
                            <GridColumn Field="@(nameof(GetNavigationNodesModel.Name))" />
                        </GridColumns>
                    </TelerikGrid>

    private async Task OnStrategicSelectAsync(IEnumerable<GetNavigationNodesModel> selectedItems)
    {
        selectedStrategic = selectedItems;

        var state = tacticalGrid.GetState();

        var compositeFilter = new CompositeFilterDescriptor() { LogicalOperator = FilterCompositionLogicalOperator.Or };
        foreach (var item in selectedItems)
        {
            compositeFilter.FilterDescriptors.Add(new FilterDescriptor()
            {
                Member = "ParentId",
                Operator = FilterOperator.IsEqualTo,
                Value = item.Id
            });
        }

        state.FilterDescriptors.Clear();
        state.FilterDescriptors.Add(compositeFilter);

        await tacticalGrid.SetState(state);
    }

Bob
Top achievements
Rank 1
Iron
Veteran
Iron
commented on 19 Aug 2021, 02:48 PM

The problem appears to happen when you select an item and then un-select it.  The event fires when it is selected, but doesn't fire when it is un-selected.

1 Answer, 1 is accepted

Sort by
0
Hristian Stefanov
Telerik team
answered on 23 Aug 2021, 03:09 PM | edited on 23 Aug 2021, 04:16 PM

Hi Bob,

I see that you already have logged a bug report on our Public Feedback Portal - SelectedItemsChanged event not firing upon unchecking a row. Thank you for that. The status is set to "Unplanned", which means that this is a verified/confirmed bug, but with no scheduled date for implementation yet. Since you are the creator of this bug report, you are automatically subscribed to receive email notifications on status updates.

We prioritize bug reports depending on interest. With your vote already added there, the item popularity is increased.

I'm sorry to confirm that using a void handler remains the only option to avoid the problem in the meantime.

Let me know if you have any other questions.

Regards,
Hristian Stefanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Bob
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Hristian Stefanov
Telerik team
Share this question
or