DataGrid CellRender event handler overrides style attribute

Hi, I have the following column in a RadzenDataGrid:
<RadzenDataGridColumn TItem="Item" Property="@nameof(Item.Amount)" Width="150px" FormatString="{0:n}" Title="Сума" TextAlign="TextAlign.Right"/>
but the displayed text doesn't get right-aligned. Using browser's developer tools I don't see any CSS rule which overrides text alignment for the cell.
I'll appreciate any ideas on the subject. If no other clues, I'll use the DataGrid CellRender event to explicitly specify text-align style attribute...

Hi @Joro,

Setting TextAlign should set the style attribute of the cell. Here is a screenshot:

Hi @korchev,
you're right, and it happens that I'm overriding the style in CellRender event. I'm trying to preserve already defined style for the cell by checking DataGridCellRenderEventArgs.Attributes, but it is empty.
It is now different problem, and probably should move it to a new topic, but how can be preserved style set by Width and TextAlign properties and added additional style elements (lets say background-color) as conditional formatting using CellRender event handler?

Indeed setting the style attribute in CellRender should not override the existing style. We will fix that with the next Radzen.Blazor release.

Ok, thank you.
As a workaround, this is how I did it:
CellRender="@(args => GridCellRender(args, args.Data.Status))"

protected void GridCellRender(DataGridCellRenderEventArgs<T> args, string condition) {
    string addStyle = args.Attributes.ContainsKey("style") ? args.Attributes["style"].ToString() : "";
    if (args.Column.TextAlign != TextAlign.Left && (string.IsNullOrWhiteSpace(addStyle) || !addStyle.Contains("text-align:"))) {
        if (!string.IsNullOrWhiteSpace(addStyle) && !addStyle.EndsWith(";")) {
            addStyle = $"{addStyle}; ";
        }
        string textAlign = args.Column.TextAlign switch { TextAlign.Center => "center", TextAlign.Right => "right", _ => "left" };
        addStyle = $"{addStyle}text-align: {textAlign}";
    }
    if (!string.IsNullOrWhiteSpace(args.Column.Width) && (string.IsNullOrWhiteSpace(addStyle) || !addStyle.Contains("width:"))) {
        if (!string.IsNullOrWhiteSpace(addStyle) && !addStyle.EndsWith(";")) {
              addStyle = $"{addStyle}; ";
        }
        addStyle = $"{addStyle}width: {args.Column.Width}";
    }
    KeyValuePair<string, object> attr = GetGridCellBackgroundColor(args.Data, condition, addStyle);
    if (!string.IsNullOrEmpty(attr.Key)) {
        args.Attributes.Add(attr);
    }
}