This is a migrated thread and some comments may be shown as answers.

Grid - CheckBox Column

1 Answer 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcel Härry
Top achievements
Rank 1
Marcel Härry asked on 10 Nov 2017, 12:01 PM

Hello Telerik Support Team (or to whom it may concern otherwise)

 

I have a boolean property bound to a Grid control column.
I would like to have a checkbox in that column that represents the boolean value of the model.
Here's a screenshot of how it currently looks (the 'Ja'/'Nein' is just a Client Template that i added temporarly, that one should be a checkbox)

Here's the screenshot:
https://i.imgur.com/ScvwCLo.png

Here's the code of the View:
https://pastebin.com/9WED8qAN

Here's the viewmodel behind the grid:
https://pastebin.com/gfY8d6dH

How can I do this?

Of course I googled around. But I only found javascript solutions that circumvented the usual asp.net core MVC logic. Plus none of the examples I found actually worked. So I'd like to know how I can do this in my particular case.

 

Thanks in advance.

And of course, if you need some more code, I can provide it on a need to know basis.

 

 

1 Answer, 1 is accepted

Sort by
0
Marcel Härry
Top achievements
Rank 1
answered on 10 Nov 2017, 01:04 PM

Never Mind. I managed to solve my problem

 

.Editable(e => e.Mode(GridEditMode.InLine))

plus columns.Command(command => { command.Edit().Text("BEARBEITEN"); command.Destroy().Text("LĂ–SCHEN"); });

did the trick.

You may delete the thread now.

Tags
Grid
Asked by
Marcel Härry
Top achievements
Rank 1
Answers by
Marcel Härry
Top achievements
Rank 1
Share this question
or