How to select rows and cells?

Hi,

I have a grid where I need to be able to select rows and cells... but when using your example it only select rows, how to select cells and not rows?


Here is my Grid:

<SfGrid DataSource="@Orders" AllowSelection="true" AllowPaging="true" EnableHover="false" Width="100%">

    <GridSelectionSettings Type="Syncfusion.Blazor.Grids.SelectionType.Multiple" Mode="SelectionMode.Both"></GridSelectionSettings>

    <GridColumns>

        <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn>

        <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"></GridColumn>

        <GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn>

        <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>

    </GridColumns>

</SfGrid>


1 Reply

NP Naveen Palanivel Syncfusion Team April 29, 2022 12:32 PM UTC

Hi Anders,


Greetings from Syncfusion support.

Query: “How to select rows and cells


We have analyzed the reported issue with the provided code and we would like to inform you that you have defined the mode property correctly to select both cell as well as row.


When selecting a row, both cell as well row will be selected. Since entire row is selected. Cell selection is not properly visible.  While using Bootstrap4 theme, we can find the difference between the row and cell selection. refer the below Screenshot your reference




We can use public method to select particular cell programmatically. 


Please get back to us if you have further queries.


Regards,

Naveen Palanivel,


Loader.
Up arrow icon