We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Checkbox column on Grid with selectionmode="none" isn't able to be clicked

i have  a GridCheckBoxColumn  but I don't want the grid to have the selecting cells thing - so I set that to "none", but now the checkbox is not able to be used.
Is there a way round this?
Thanks for any help!

3 Replies

JP Jagadeesan Pichaimuthu Syncfusion Team January 14, 2019 08:21 AM UTC

Hi Tom, 
 
Thank you for contacting Syncfusion support. 
 
We have analyzed your query and we are able to reproduce the reported problem “GridCheckboxColumn checkbox not enabled when the SelectionMode is None” and this is the default behavior of SfDatagrid. 
 
And you can achieve your requirement with SelectionMode as single by using the below code snippets. 
<syncfusion:SfDataGrid x:Name="sfdatagrid" Grid.Column="0" 
                        AutoGenerateColumns="False" 
                        AllowEditing="True" 
                        CurrentCellBorderBrush="Transparent" 
                        RowSelectionBrush="Transparent" 
                        AllowGrouping="True" 
                        ShowRowHeader="True" 
                        SelectionUnit="Cell" 
                        SelectionMode="Single" 
                        ItemsSource="{Binding OrderDetails}"> 
 
 
public class GridCellSelectionControllerExt : GridCellSelectionController 
{ 
    public GridCellSelectionControllerExt(SfDataGrid dataGrid) : base(dataGrid) 
    { 
 
    } 
    protected override void ProcessPointerPressed(MouseButtonEventArgs args, RowColumnIndex rowColumnIndex) 
    { 
        var columnIndex = this.DataGrid.ResolveToGridVisibleColumnIndex(rowColumnIndex.ColumnIndex); 
        var column = this.DataGrid.Columns[columnIndex]; 
        if (column is GridCheckBoxColumn) 
        {          
            base.ProcessPointerPressed(args, rowColumnIndex); 
        } 
    } 
    protected override void ProcessKeyDown(KeyEventArgs args) 
    { 
        return; 
    } 
} 
 
Please find the sample from the below location. 
 
Regards, 
Jagadeesan


TO Tom January 14, 2019 10:10 AM UTC

Thanks, yep that does the job.


JN Jayaleshwari N Syncfusion Team January 16, 2019 12:23 PM UTC

Hi Tom, 
 
Thanks for the update. Please get in touch if you would require further assistance. 

Regards,
 
Jayaleshwari N. 


Loader.
Live Chat Icon For mobile
Up arrow icon