Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / How to clear the selection of igx select in igx grid?

How to clear the selection of igx select in igx grid?

New Discussion
Prabu kuppusamy
Prabu kuppusamy asked on Sep 24, 2020 7:39 AM

HI,

We are using igx grid and a column having igx select, In My scenario, I have to select the igx select and based on the selected item, I need to check some business logic and based on the result I need to clear the selection.

I have tried multiple ways, but None of the code is working as expected, we are unable to clear the selection.

onCurrencyChange($event, cell: IgxGridCellComponent) {

      cell.value = null;
      cell.rowData['currencyType'] = null;
      cell.rowData['currencyId'] = null;
}
The above code didn’t work, and I have prepared new grid collection and bind the grid again, still the selection is not cleared.
Kindly help on this scenario.
Thank you
Sign In to post a reply

Replies

  • 0
    Martin Evtimov
    Martin Evtimov answered on Sep 21, 2020 1:50 PM

    Hello Prabu,

    Thank you for contacting Infragistics Community!

    Could you please provide some additional information regarding the issue you are facing? Can you please elaborate on where do you display this igx-selection, within an igxCell or igxCellEditor template and which value Is bind to this selection – the cell value or the cell editValue?

    Ideally it would be very helpful if you can provide a small isolated sample which replicates the described behavior so I will be able to investigate it further and try to provide you with a solution as soon as possible.

    Looking forward for your reply!

    Best Regards,
    Martin Evtimov
    Entry Level Software Developer
    Infragistics, Inc.

    • 0
      Prabu kuppusamy
      Prabu kuppusamy answered on Sep 22, 2020 1:55 PM

      We use both IgxCell and IgxCellEditor, The selected text showing igx cell after cell edit completed/ done.

      On change the igx select, we are using igxCellEditor.

      While selecting the item from the igx select, we are checking some business logic, and based on the logic, we need to allow to set the selected item or we need to clear the selected item.

      In this case, I”m unable to clear the selected item.

      I tried to clear the grid cell values as below.

        cell.value = null;
        cell.rowData['currencyType'] = null;
        cell.rowData['currencyId'] = null;

      and I bind the grid with new updated data, still it’s not get cleared.

      and tried to reset the igx-select – $event’s new selection as below.
      $event.newSelection.id = 0;
      $event.newSelection.value = "";
      If the above information is not enough, I’ll try to create sample application and ‘ll give you the link.
      • 0
        Prabu kuppusamy
        Prabu kuppusamy answered on Sep 23, 2020 9:33 AM

        Hi,

        I have achieved this scenario by making the $event.cancel true on igx-select event, but Now I'm facing another issue with this scenario.

        If I select an item in igx-select and based on condition I'm allowed to set the selected value,

        then I'm selecting another value, now based on condition i'm setting $event.cancel = true, in this case the igx-select still showing the old value, it is not cleared.

        This is my stackblitz link, In this example, the igx grid having country column, 

        Please check my scenario in the example,

        grid-cascading-scenario.component.ts this is file, the country change event written.

        Kindly help. Please let know if any more details needed.

        Thank you.

      • 0
        Martin Evtimov
        Martin Evtimov answered on Sep 23, 2020 1:47 PM

        Hello Prabu,

        Thanks for your replies!

        I have modified the provided sample so that if the user selects United States as a country the selection gets cleared and the cell value is set to be null. Please take a look at the attached sample and let me know if you need any further information.

        Looking forward for your reply!

        Best Regards,
        Martin Evtimov
        Entry Level Software Developer
        Infragistics, Inc.

      • 0
        Prabu kuppusamy
        Prabu kuppusamy answered on Sep 24, 2020 7:22 AM

        Thank you so much, it is working fine. the cell.update(null) helped.

      • 0
        Martin Evtimov
        Martin Evtimov answered on Sep 24, 2020 7:39 AM

        Hello Prabu,

        I’m glad that you find the provided sample helpful.

        Thank you for using Infragistics Components!

        Best Regards,
        Martin Evtimov
        Entry Level Software Developer
        Infragistics, Inc.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Prabu kuppusamy
Favorites
0
Replies
6
Created On
Sep 24, 2020
Last Post
5 years, 5 months ago

Suggested Discussions

Created by

Created on

Sep 24, 2020 7:39 AM

Last activity on

Feb 25, 2026 8:00 AM