Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DataGrid header column options on the left side of text#7710

MandersAtACA started this conversation inGeneral
Discussion options

I have a datagrid with an amount column and I want to align it to the right, as you normally do with amount columns.
But I cannot align the header to the right because there is always the column options element to the right of the text, even if you disable the options.
But I like to keep the options but also would like the header text to line up with the values, so basically put the options to the left of the text.
Is there a way to do this (css ? I've been trying but cannot get it to work) , or is it possible to include a column-options-position setting in a next build ?

You must be logged in to vote

Replies: 3 comments

Comment options

I have the same issue, this is the closest I've got to a solution by using HeaderClass

<PropertyColumn Property="x => x.goods_value" HeaderClass="d-flex justify-end" Title=@Loc["goods"] Sortable="false" Filterable="false" CellStyle="text-align: right" Format="N2"/>

It works for one column, but when I apply the same to another column they just become stacked. I'm no css expert so I'm probably missing something. I've just updated to 7.0.0-rc.1 and I can't see that it behaves any differently.

You must be logged in to vote
0 replies
Comment options

You can use this solution also:

.header-layout {
display: flex;
justify-content: space-between;
align-items: center;
}

.column-options {
order: -1; /* Forces icons to the left */
}

.column-name {
order: 1; /* Aligns text to the right */
text-align: right;
flex-grow: 1;
}

<PropertyColumn Property="x => x.Quantity" Format="N2" Title="Quantity" HeaderClass="header-layout">

You must be logged in to vote
0 replies
Comment options

Apply a HeaderClass to the column

<PropertyColumn HeaderClass="custom-header">

Then use the class to modify the<span> element within the header:

.custom-header span {    display: block !important;    text-align: right !important;}
You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
4 participants
@MandersAtACA@foxy0669@marjanoh2@WebStatik

[8]ページ先頭

©2009-2025 Movatter.jp