Checkbox in Grid

Hello RadZen Team,
i have two questions…

  1. is there a way to get chekboxes instead the Text “True”/“False” in grid?

  2. to filter a bit field (Boolean True/False) in datagrid one must type true or false in filter field. What must i do to do it in german? something like typing “j” or “n” were great. Users are not familiar with true/false :slight_smile:

Regards
Thomas

Hi Thomas,

  1. Yes, you can use the Template property of a column and add a checkbox. Here is a quick template that will get a disabled checkbox (you can also use the template designer)
    <rz-checkbox [value]="data?.CheckboxProperty" [disabled]="true" [triState]="true"></rz-checkbox>
  2. Good catch! We have implemented checkbox filtering UI for boolean columns and it will be included in the next Radzen release.

Best regards,
Atanas

1 Like

Hi Atanas,
i use the <rz-checkbox [value]=“data?.CheckboxProperty” [disabled]=“true” [triState]=“true”> in a data grid and it works fine!

Thank you!

Regards
Thomas

Hi Atanas,
i have used the Template Editor to get a checkbox in a datagrid column.
Json:
{
"property": "Handelsware",
"template": [
{
"name": "checkbox0",
"type": "checkbox",
"value": "Handelsware"
}
],
"title": "Handelsware",
"type": "boolean"
},

Template Editor:

But the chekbox in the datagrid is always empty. No matter if true/false/null is set.
Video
What did i miss?

Kind Regards
Thomas

btw… is it possible to center the checkbox in the datagrid column?

Thomas

Hi Thomas,

Try setting the Value to ${data.Handelsware}

Best,
Atanas

Hi Atanas,
ive done so and it works fine!

Thank you!
Thomas

Sorry if i asked twice but the checkbox at the left looks not so great.
It surely is nice if the checkbox can be shown in the center of the column.

Kind Regards
Thomas

Hi @ThomasS,

You can simply wrap the checkbox in a DIV with text-align:center
<div style='text-align:center'><rz-checkbox [value]="data?.CheckboxProperty" [disabled]="true" [triState]="true"></rz-checkbox></div>

Best Regards,
Vladimir

<div style='text-align:center'><rz-checkbox [value]="data?.CheckboxProperty" [disabled]="true" [triState]="true"></rz-checkbox></div>

I know this is an old topic, but...

I have a Blazor project with a grid. I have added the template as above (of course, changing the property name to the right value) but I can't get anything to show up in the column when I use a template - the column appears blank. Remove the template and I get the standard True/False values.

The data returned in these columns are bit types.

I also tried using the designer - dragged and dropped a checkbox on the designer, named it and set the property to ${data.IsPrivate}. When I exit the designer, the grid is replaced with an error message telling me the checkbox can't find a form.

So how do you do this again...?

Hi @dferreira042,

This topic (and the syntax) is for Angular. For Blazor you can check this thread:

I was pretty brain-fried yesterday afternoon. I realized that it was Angular sometime in the middle of the night.

That said, I tried it with native Radzen components in the template editor and it did not work, so I ended up using standard HTML checkboxes. Now it does.

Thanks for you help and patience with stupid questions...