This example illustrates how to prevent users from selecting specific data items in the DevExpress Grid for Blazor. The Grid component's selection column displays checkboxes that allow users to select and deselect items. In this example, the component disables these checkboxes for items whose Summary
field is set to Mild
.
Follow the steps below to allow users to select only the items that match your criteria:
-
Use the DxGridSelectionColumn's CellDisplayTemplate to replace the built-in checkbox with a custom DxCheckBox editor.
-
Implement two-way data binding between the Checked property of the checkbox and the template context's Selected property.
-
Set the checkbox's Enabled property to
true
orfalse
, depending on whether the current item matches your criteria.
- Grid for Blazor - How to display detail information using DxFormLayout
- Grid for Blazor - How to delete selected rows
(you will be redirected to DevExpress.com to submit your response)