Multiple selection only on specific rows

Hello,

is it possible to enable multiple selection only on specific rows according to some flag? Let's say that this flag could be number 1 or something similar. This flag is also in grid grouping control displayed in column and loaded from table from database?

3 Replies

MG Mohanraj Gunasekaran Syncfusion Team November 13, 2017 09:29 AM UTC

Hi Josip, 

Thanks for using Syncfusion product. 

In order to avoid the selection based on the specific column value, The SelectedRecordsChanging event can be used to handle the selection and Record.GetValue method can be used to get the specific column value from the record. Please refer to the below code example, 

Code example 
this.gridGroupingControl1.Table.SelectedRecordsChanging += Table_SelectedRecordsChanging; 
 
void Table_SelectedRecordsChanging(object sender, Syncfusion.Grouping.SelectedRecordsChangedEventArgs e) 
{ 
    if (e.Action == Syncfusion.Grouping.SelectedRecordsChangedType.Added) 
    { 
        String value = e.SelectedRecord.Record.GetValue("Select").ToString(); 
        if (!value.Equals("1")) 
            e.Cancel = true; 
    } 
} 
 
 
Sample link: GridGroupingControl 
 
Please let us know if you have any concerns. 
 
Regards, 
Mohanraj G 
 



JO Josip November 13, 2017 09:16 PM UTC

Thanks a lot. That's exactly what I needed.



MG Mohanraj Gunasekaran Syncfusion Team November 14, 2017 03:58 AM UTC

Hi Josip,  
 
Thanks for your update. 
 
We are glad to know that your reported problem has resolved. 
 
Please let us know if you have any concerns. 
 
Regards, 
Mohanraj G 


Loader.
Up arrow icon