140
Views
5
Comments
How to set column names in Datagrid
Question
Application Type
Reactive
Service Studio Version
11.54.16 (Build 62588)

In the properties of the Datagrid, "Entities.RowHeader.RowCheckbox" is selected for the RowHeader.

I want the title to be displayed at the top so that you can see what the checkbox is for, but I don't know how to do it, so I need help. I also want to hide the checkbox for selecting all that is displayed by default.

UserImage.jpg
Puja Rani

Hi, 

If I understood correctly, for checkbox column you need to add Header title instead of checkbox(select all) in header. You can just add custom text in header attribute in checkbox column.


UserImage.jpg
Suzuki Hiroaki

Thank you for your answer.

However, this time we are not using a checkbox column. A check box has been added from the properties of the DataGrid.

I don't want to use it if possible, because I think it is necessary to prepare a column for binding when using a checkbox column.

UserImage.jpg
Puja Rani

Ok, using CSS we can hide the select all checkbox from header. But not sure about if can add header title.

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @Suzuki Hiroaki ,

you can get something kind of working with CSS, but it is a bit hacky and fragile, so you should really test very good if this works in all circumstances

add a container around your grid with the class "grid-has-no-group-selector", and than add this css

the first hides the checkbox

the second stops the select all behaviour and undoes the center alignment

the third sets a text, and moves it to the right spot

This last bit specifically (the 18px and 6px), is I think the most fragile part of it.

You will have to be concise in your wording for the title, they have used inline width for those column headers, so no easy way to get around that, unless you start getting very messy and using a lot of !important.

Dorine

UserImage.jpg
Suzuki Hiroaki

Thank you

I was able to uncheck the checkbox with CSS, but I couldn't find a way to put a title. I'll try to investigate a little more.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.