Selecting multiple checkboxes in the grid with mode as both

Is it possible to get multiple checkboxes to select when selection mode is both? as soon as I take off both to row it works.
I have cell selection as well because I have a function that will go into the cell in there is a single click.
I just want to have it so I can select multiple checkboxes by clicking on the checkboxes with this requirement on but doesn't seem to work. here is my grid code. 
Also I noticed that it will select multiple checkboxes if i hold down ctrl or use shift.. but the shift seems to work only if i select a row and click on rows upwards in the grid.  If i select a row and select a row down in the grid, it seems to stop highlighting after 2 records...

I attached a video

 

                               
                               
                               
                               
                               
                                   
                                   
                                   
                                   
                                   
                                       

                                           
                                               
                                               
                                                   
                                                       
Address
                                                   
                                                   
                                                       
@((context2 as FDILocationAddress).locationAddress)
                                                   
                                               
                                               
                                           

                                       

                                   


                                   
                                       
                                            @{var currItem = (context as FDIChemicalOrderLine);

                                               
                                                   
                                                   
                                                       
                                                           
Item NumberSearch Name
                                                       
                                                       

                                                           
@((context2 as FDIItemID).itemid)@((context2 as FDIItemID).NameAlias)
                                                       
                                                   
                                                   

                                               

                                            }
                                       

                                   

                                   

                               
                           

7 Replies

CJ chris johansson October 30, 2020 07:23 PM UTC

 <SfGrid AllowSelection="true" @ref="GridInstance" DataSource="@chemOrderLines" AllowPaging="false" AllowFiltering="true" AllowSorting="true" AllowMultiSorting="true" AllowResizing="true" Width="1200" AllowReordering="true" ShowColumnChooser="true" Toolbar="Toolbaritems" Height="600">

                                <GridPageSettings PageSize="25"></GridPageSettings>
                                <GridSelectionSettings Type="Syncfusion.Blazor.Grids.SelectionType.Multiple" Mode="Syncfusion.Blazor.Grids.SelectionMode.Both"></GridSelectionSettings>
                                <GridEditSettings ShowConfirmDialog="false" AllowAdding=@IsGridEditable  AllowEditing=@IsGridEditable AllowDeleting=@IsGridEditable AllowNextRowEdit="true" Mode="EditMode.Batch"></GridEditSettings>
                                <GridEvents OnToolbarClick="ToolbarClickHandler" Created="onGridCreated" CellSelected="CellSelectHandler" RowSelecting="RowSelectingHandler" TValue="FDIChemicalOrderLine" OnBatchSave="OnSave" OnBatchDelete="OnDelete" OnBatchAdd="OnAdd" OnActionComplete="RefreshGrid"></GridEvents>
                                <GridColumns>
                                    <GridColumn Type="ColumnType.CheckBox"  Width="40"></GridColumn>
                                    <GridColumn FilterSettings="@(new FilterSettings { Operator = Syncfusion.Blazor.Operator.Contains })" Field=@nameof(FDIChemicalOrderLine.ID) IsPrimaryKey="true" ValidationRules="@(new ValidationRules { Required = true })" HeaderText="ID" Visible="false" TextAlign="TextAlign.Right" Type="ColumnType.Number" AutoFit="true"></GridColumn>
                                    <GridColumn FilterSettings="@(new FilterSettings { Operator = Syncfusion.Blazor.Operator.Contains })" Field=@nameof(FDIChemicalOrderLine.SortOrder) HeaderText="Sort Order" TextAlign="TextAlign.Right" Type="ColumnType.Number" AutoFit="true"></GridColumn>
                                    <GridColumn FilterSettings="@(new FilterSettings { Operator = Syncfusion.Blazor.Operator.Contains })" Field=@nameof(FDIChemicalOrderLine.FSBillingLocationId) HeaderText="Billing Location" AutoFit="true"> </GridColumn>
                                    <GridColumn FilterSettings="@(new FilterSettings { Operator = Syncfusion.Blazor.Operator.Contains })" Field=@nameof(FDIChemicalOrderLine.FSDeliveryLocationId) HeaderText="Delivery Location" TextAlign="TextAlign.Right" EditType="EditType.DropDownEdit" Width="200">
                                        <EditTemplate>

                                            <SfComboBox @ref="comboboxLocationAddress" ID="FSDeliveryLocationId" TValue="string" TItem="FDILocationAddress" @bind-Value="(context as FDIChemicalOrderLine).FSDeliveryLocationId" Placeholder="e.g. 02-36-001-13W2" CssClass="e-multi-column" DataSource="@locationAddresses" AllowFiltering="true" PopupWidth="400px">
                                                <ComboBoxFieldSettings Text="locationAddress" Value="locationAddress"></ComboBoxFieldSettings>
                                                <ComboBoxTemplates TItem="FDILocationAddress">
                                                    <HeaderTemplate>
                                                        <table><tr><th class="e-text-center">Address</th></tr></table>
                                                    </HeaderTemplate>
                                                    <ItemTemplate Context="context2">
                                                        <table><tbody><tr><td class="e-text-center">@((context2 as FDILocationAddress).locationAddress)</td></tr> </tbody></table>
                                                    </ItemTemplate>
                                                </ComboBoxTemplates>
                                                <ComboBoxEvents TValue="string" TItem="FDILocationAddress" Filtering="onFilteringLocation" ValueChange="@filterLocationValueChange"></ComboBoxEvents>
                                            </SfComboBox>

                                        </EditTemplate>

                                    </GridColumn>


                                    <GridColumn Field=@nameof(FDIChemicalOrderLine.itemid) HeaderText="ItemID" EditType="EditType.DropDownEdit" TextAlign="TextAlign.Right" Width="150">
                                        <EditTemplate>
                                            @{var currItem = (context as FDIChemicalOrderLine);

                                                <SfComboBox @ref="comboboxItemID" ID="itemid" TValue="string" TItem="FDIItemID" @bind-Value="(context as FDIChemicalOrderLine).itemid" Placeholder="e.g. item" CssClass="e-multi-column" DataSource="@ItemIDs" AllowFiltering="true" Query="@itemQuery" PopupWidth="600px" PopupHeight="400px" EnableVirtualization="true">
                                                    <ComboBoxFieldSettings Text="itemid" Value="itemid"></ComboBoxFieldSettings>
                                                    <ComboBoxTemplates TItem="FDIItemID">
                                                        <HeaderTemplate>
                                                            <table><tr><th class="e-text-center">Item Number</th><th class="e-text-center">Search Name</th></tr></table>
                                                        </HeaderTemplate>
                                                        <ItemTemplate Context="context2">

                                                            <table><tbody><tr><td class="e-text-center">@((context2 as FDIItemID).itemid)</td><td class="e-text-center">@((context2 as FDIItemID).NameAlias)</td></tr> </tbody></table>
                                                        </ItemTemplate>
                                                    </ComboBoxTemplates>
                                                    <ComboBoxEvents TValue="string" TItem="FDIItemID" Filtering="onFilteringItemID" ValueChange="FilterItemIDValueChange"></ComboBoxEvents>

                                                </SfComboBox>

                                            }
                                        </EditTemplate>

                                    </GridColumn>

                                    <GridColumn Field=@nameof(FDIChemicalOrderLine.NameAlias) Uid="NameAlias" HeaderText="Name" AutoFit="true" AllowEditing="false"></GridColumn>

                                </GridColumns>
                            </SfGrid>

Attachment: GridSelection_cbbf294e.zip


RS Renjith Singh Rajendran Syncfusion Team November 2, 2020 01:11 PM UTC

Hi Chris, 

Greetings from Syncfusion support. 

Query 1 : I just want to have it so I can select multiple checkboxes by clicking on the checkboxes with this requirement on but doesn't seem to work. 
We have confirmed it as a bug and logged the defect report “Problem with multi-selection using Checkbox when having SelectionMode as Bothfor the same. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and including the defect fix in our upcoming bi-weekly release which is expected to be rolled by the end of November, 2020. 
    
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.    

Query 2 : but the shift seems to work only if i select a row and click on rows upwards in the grid.  If i select a row and select a row down in the grid, it seems to stop highlighting after 2 records... 
We tried reproducing the reported problem by creating a sample based on the shared code. But we could not face this problem, shift + down arrow selecting multiple records works fine form our side. We are attaching the sample which we have tried from our side for your reference. 
 
Please refer the above attached sample and if we have misunderstood your query or if you are still facing difficulties, then the following details would be helpful for us to proceed further. 
  1. Share the sample which you have tried form your side.
  2. Or if possible, reproduce the problem with the attached sample and share with us for further analysis.
  3. Share the exact scenario, or proper replication procedure.

The provided information will help us analyze the problem, and provide you a solution as early as possible. 

Regards, 
Renjith Singh Rajendran 



CJ chris johansson November 2, 2020 10:38 PM UTC

OK thanks.
I see that it works in a basic scenario... Only issue is I have alot of events and other things going on in the grid.  Its possible some how that's being affected probably.
For example I use a click event where instead of double clicking, I use single clicking to enter the cell.  

  public async Task CellSelectHandler(CellSelectEventArgs<FDIChemicalOrderLine> args)
    {
        //  get selected cell index
        var CellIndexes = await GridInstance.GetSelectedRowCellIndexes();

        //get the row and cell index
        // double rowIndex = args.RowIndex;
        double oldRowIndex = CurrentEditRowIndex;
        CurrentEditRowIndex = args.RowIndex;
        var CurrentEditCellIndex = (int)CellIndexes[0].Item2;

        //get the available fields
        var fields = await GridInstance.GetColumnFieldNames();
        // edit the selected cell using the cell index and column name
        if (CurrentEditCellIndex != 0)
            await GridInstance.EditCell(CurrentEditRowIndex, fields[CurrentEditCellIndex]);
}


RS Renjith Singh Rajendran Syncfusion Team November 3, 2020 10:47 AM UTC

Hi Chris, 

Thanks for your update. 

We would like to inform you that, when perform single click edit in Grid, the selection action will trigger Edit action in Grid. And here the selection will behave as edit action. 

So at these cases(single click edit), you can’t perform multi-selection. Multi-selection is not a feasible requirement, as clicking/highlighting on the cell will move the cell to edited state, and thereby preventing further selection. 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 



CJ chris johansson January 15, 2021 04:23 PM UTC

Has this ever been fixed? i see "scheduled" in the tracking link

Problem with multi-selection using Checkbox when having SelectionMode as Both


CJ chris johansson January 19, 2021 03:22 AM UTC

Anyone update on this? thanks


RS Renjith Singh Rajendran Syncfusion Team January 19, 2021 12:58 PM UTC

Hi Chris, 

Sorry for the inconvenience caused. 

Due to unforeseen circumstances, we are unable to include the fix for this issue in our bi-weekly release. The fix for reported issue will be included in our upcoming bi-weekly patch release which is expected to be rolled out by end of February 2021.  
      
Until then we appreciate your patience.   
  
Regards,  
Renjith R 


Loader.
Up arrow icon