Onclick event in ListBox selection mode in Wijmo FlexGrid

Posted by: rambabu on 28 February 2024, 4:24 am EST

  • Posted 28 February 2024, 4:24 am EST

    Tried implementing checkbox by adding in the innerhtml in item formatter.

    The event handler for checkbox click is also written. The event doesn’t fire until the second click on the check box.

    If converting it to Row selection mode then I am not able to selecting multiple rows by ctrl+ click.

    I want both the functionalities: Checkbox click & Select and multiple row select by ctrl+ click.

    Any suggestions would be helpful.

  • Posted 29 February 2024, 12:07 am EST

    Hi Rambabu,

    As per my understanding, you want to select the row using a checkbox that is placed in the rowHeader cells of the FlexGrid. If this is the requirement, then it is recommended to use the Selector class instead of creating custom checkboxes. However, if there is some complex use case for which you are creating checkbox using itemFormatter, then please let me know so that I can assist you as per your use case.

    Also, to select the row using Ctrl+Click please set the selectionMode to ‘ListBox’. To display the updated state of the selector, please call the refresh() method of FlexGrid in the handler of selectionChanged event.

    Please refer to this code snippet for reference:

    let selector = new Selector(theGrid);
        theGrid.selectionMode = wjGrid.SelectionMode.ListBox;
        theGrid.selectionChanged.addHandler((sender) => {
            sender.refresh();
        });

    Please refer to this sample for reference: Sample.zip

    In case if you have any further queries then please let me know.

    Thank you.

    Regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels