Skip to content

DevExpress-Examples/blazor-dxgrid-disable-selection-checkboxes-by-condition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blazor Grid - Disable Selection Checkboxes in Specific Rows

This example prevents users from selecting specific data items in the DevExpress Blazor Grid.

Grid with Disabled Selection Checkbox

A selection column displays checkboxes that selects/deselects Blazor Grid items. In this example, the Grid component disables selection checkboxes for items whose Summary field is set to Mild. The Select All checkbox also ignores these items.

Implementation Details

Follow the steps below to enable selection only for items matching your criteria:

  1. Use the DxGridSelectionColumn.CellDisplayTemplate to replace the built-in checkbox with a custom DxCheckBox editor.

  2. Implement two-way data binding between the Checked checkbox property and the template context's Selected property.

  3. Set the Enabled property to true/false, based on the current item.

  4. Place another DxCheckBox component in the DxGridSelectionColumn.HeaderTemplate to display a custom Select All checkbox.

  5. Configure this checkbox to support three states (checked, unchecked, and indeterminate).

  6. In the CheckedChanged event, select/deselect all Grid records that match your criteria.

  7. Update the Select All checkbox state when the Grid raises the SelectedDataItemsChanged event.

Files to Review

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

This example demonstrates how to disable CheckBoxes in the Selection Column in specific rows.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 6