Customize the Grid selection

1 Answer 152 Views
Button Checkbox Grid
Satish
Top achievements
Rank 1
Iron
Satish asked on 09 Feb 2022, 08:44 PM

Is there a way I can replace the checkbox with button for the selection of the row in the grid?

 

Blazor DataGrid Demos - CheckBox Only Selection | Telerik UI for Blazor

1 Answer, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 10 Feb 2022, 08:10 PM

Hi Satish,

You can:

  1. remove the built-in selection column
  2. add a column of your own that has no Field set
  3. use its Template to add the desired button
  4. use the OnClick of the button with a lambda to pass the current row model and update the selected items collection yourself

 

Regards,
Marin Bratanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Satish
Top achievements
Rank 1
Iron
commented on 16 Feb 2022, 07:03 PM

Thank you Marin.  Can you tell me how to customize the grid header color?  
Marin Bratanov
Telerik team
commented on 17 Feb 2022, 07:10 PM

You can use the browser dev tools to inspect the rendered HTML and the CSS rules that apply to it (this can be a good starting point) and then devise the CSS rules that will provide you with the desired coloring.
Satish
Top achievements
Rank 1
Iron
commented on 17 Feb 2022, 08:04 PM

HI Marin,

If I have the following in my Razor component, it works, but when moved to site.css file, it doesn't.


<style>
.k-grid-header {
    background:red;
}
</style>

Marin Bratanov
Telerik team
commented on 17 Feb 2022, 08:25 PM

This is likely due to the order and specificity of the selectors. Try making yours heavier.
Tags
Button Checkbox Grid
Asked by
Satish
Top achievements
Rank 1
Iron
Answers by
Marin Bratanov
Telerik team
Share this question
or