Row Selections

Hi.. 

I need a little help. I want select many row on my grid, when I click at checkbox, but I need select every row before.
Example:
When I select the 3 row, I need check row 1, 2 and 3.
And I need every has one row selected.. How I can do that?



3 Replies 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team January 8, 2021 10:45 AM UTC

Hi Thomaz, 

Greetings from Syncfusion support. 

We suggest you to use the SelectRows method of Grid in OnRecordClick event handler to achieve this requirement. Please refer and use as like the codes below, 

<SfGrid @ref="Grid" DataSource="@Orders" AllowSelection="true" AllowPaging="true"> 
    <GridSelectionSettings Type="SelectionType.Multiple" CheckboxOnly="true"></GridSelectionSettings> 
    <GridEvents OnRecordClick="OnRecordClick" TValue="Order"></GridEvents> 
    ... 
</SfGrid> 

public List<double> SelectIndexes { getset; }public void OnRecordClick(RecordClickEventArgs<Order> args){    SelectIndexes = new List<double>();    for (var i = 0; i <= args.RowIndex; i++)    {        SelectIndexes.Add(i);    }    Grid.SelectRows(SelectIndexes);}

We are also attaching the sample for your reference, please download the sample from the link below, 
 
References :  

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 


Marked as answer

TL Thomaz Lima January 8, 2021 12:11 PM UTC

Hi Renjith Singh Rajendran,

Thank you help, all its allright.



RS Renjith Singh Rajendran Syncfusion Team January 11, 2021 05:01 AM UTC

Hi Thomaz, 

We are glad to hear that your requirement has been achieved. 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 


Loader.
Up arrow icon