Hi, i go a problem when try to set background-color in frozen column with Software theme
background-color: var(--rz-info-lighter)
--rz-info-lighter: rgba(44, 200, 200, 0.2);
The set transparency leads to problems with frozen columns
Example:
Code:
@using RadzenBlazorDemos.Data
@using RadzenBlazorDemos.Models.Northwind
@using Microsoft.EntityFrameworkCore
@inherits DbContextPage
<RadzenText TextStyle="TextStyle.H5" TagName="TagName.H3">Order Details</RadzenText>
<RadzenDataGrid AllowFiltering="false" AllowPaging="true" AllowSorting="false" FilterPopupRenderMode="PopupRenderMode.OnDemand" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
Data="@orderDetails" ColumnWidth="200px" AllowColumnResize="true" Style="max-width: 500px;"
CellRender="@CellRender">
<Columns>
<RadzenDataGridColumn Property="@nameof(OrderDetail.Quantity)" Title="Quantity" Frozen="true">
<Template Context="data">
@if (data.Quantity > 20)
{
<span style='color: var(--rz-text-contrast-color)'>@data.Quantity</span>
}
else
{
<span style='color: var(--rz-text-color)'>@data.Quantity</span>
}
</Template>
<FooterTemplate>
Total quantity: <b>@String.Format(new System.Globalization.CultureInfo("en-US"), "{0:C}", orderDetails.Sum(o => o.Quantity))</b>
</FooterTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn Property="@nameof(OrderDetail.OrderID)" Title="OrderID">
<FooterTemplate>
Total records: <b>@orderDetails.Count()</b>
</FooterTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn Property="@nameof(OrderDetail.ProductID)" Title="ProductID/ProductName"
SortProperty="Product.ProductName" FilterProperty="Product.ProductName">
<FooterTemplate>
Most ordered product: <b>@orderDetails.GroupBy(o => o.Product.ProductName).OrderBy(g => g.Count()).Select(g => g.Key).FirstOrDefault()</b>,
Least ordered product: <b>@orderDetails.GroupBy(o => o.Product.ProductName).OrderByDescending(g => g.Count()).Select(g => g.Key).FirstOrDefault()</b>
</FooterTemplate>
</RadzenDataGridColumn>
<RadzenDataGridColumn Property="Product.ProductName" Title="Product" />
<RadzenDataGridColumn Property="@nameof(OrderDetail.Discount)" Title="Discount" FormatString="{0:P}">
<FooterTemplate>
Average discount: <b>@String.Format("{0:P}", orderDetails.Average(o => o.Discount))</b>
</FooterTemplate>
</RadzenDataGridColumn>
</Columns>
</RadzenDataGrid>
@code {
IEnumerable<OrderDetail> orderDetails;
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
orderDetails = dbContext.OrderDetails.Include("Product").ToList();
}
void CellRender(DataGridCellRenderEventArgs<OrderDetail> args)
{
if (args.Column.Property == "Quantity")
{
args.Attributes.Add("style", $"background-color: var(--rz-info-lighter) !important;");
args.Attributes.Add("class", args.Data.Quantity > 20 ? "my-class" : "my-other-class");
}
}
}
Could you change the colors for all themes to the HEX format?