My RowRender method I add when highlight didn't work. And now it is only thing that works (commented line didn't work). It uses "style" now.
void RowRender(RowRenderEventArgs<Zakazka_mdl> args)
{
args.Attributes.Add("style", $"font-weight: {(args.Data.Id == settings.Act_order_id ? "bold" : "normal")};");
//args.Attributes.Add("class", args.Data.Id == settings.Act_order_id ? "rz-color-primary" : "rz-color-danger");
}
My RadzenDataGridSk is only for localized messages, nothing more.
Only thing I think about that maybe could cause some different behavior is my css classes overrides which creates "ultra compact" datagrid because my user wants to see more data in one screen. I tried to remove all not necessary vertical gaps. It looks like
/* ===================================== */
/* RADZEN CUSTOM OVERRIDES (MAUI BLAZOR) */
/* ===================================== */
/* --- Misc tweaks --- */
/* Expand/collapse column width */
.rz-datatable .rz-col-icon {
--rz-grid-column-icon-width: 0.75rem;
}
/* Dropdown popup auto width */
.rz-dropdown-panel.rz-popup {
width: auto !important;
}
/* ===================================== */
/* ULTRA COMPACT DATAGRID */
/* ===================================== */
/* 1. CELL BASE (remove vertical padding) */
/*.rz-datatable .rz-datatable-tbody > tr > td {
padding-top: 0 !important;
padding-bottom: 0 !important;
}*/
.rz-datatable .rz-datatable-tbody > tr > td {
height: 1.5rem !important; /* Set a minimum consistent row height */
}
/* 2. CELL CONTENT WRAPPER (CRITICAL FIX) */
.rz-datatable .rz-cell-data {
padding: 0 !important;
margin: 0 !important;
align-items: stretch !important; /* remove vertical gaps */
}
/* 3. FORCE CONTROLS TO FILL CELL */
.rz-datatable .rz-cell-data > * {
height: 100%;
margin: 0 !important;
}
/* 4. COMMON INPUT WRAPPERS */
.rz-datatable.rz-density-compact .rz-textbox,
.rz-datatable.rz-density-compact .rz-numeric,
.rz-datatable.rz-density-compact .rz-dropdown,
.rz-datatable.rz-density-compact .rz-inputtext,
.rz-datatable.rz-density-compact .rz-textarea,
.rz-datatable.rz-density-compact .rz-multiselect,
.rz-datatable.rz-density-compact .rz-calendar .rz-inputtext,
.rz-datatable.rz-density-compact .rz-spinner,
.rz-datatable.rz-density-compact .rz-colorpicker {
margin: 0 !important;
padding: 0 !important;
height: 100%;
box-sizing: border-box;
}
/* 5. REAL INPUT ELEMENT */
.rz-datatable.rz-density-compact input {
height: 100%;
margin: 0 !important;
padding: 0 2px !important;
line-height: 1rem;
box-sizing: border-box;
}
/* 6. DROPDOWN */
.rz-datatable.rz-density-compact .rz-dropdown {
height: 100%;
}
.rz-datatable.rz-density-compact .rz-dropdown-label {
line-height: 1rem;
padding: 0 2px;
}
/* 7. NUMERIC */
.rz-datatable.rz-density-compact .rz-numeric input {
padding: 0 2px !important;
}
/* 8. TEXTBOX */
.rz-datatable.rz-density-compact .rz-textbox {
padding: 0 2px !important;
}
/* 9. INPUT GROUP LABEL */
.rz-datatable.rz-density-compact .input-group-text {
padding-left: 8px;
padding-right: 8px;
font-size: 0.875rem;
height: 100%;
display: flex;
align-items: center;
}
/* 10. BUTTONS (prevent row stretching) */
.rz-datatable .rz-button {
height: 100%;
padding: 0 4px;
}
/* ===================================== */
/* DROPDOWN POPUP */
/* ===================================== */
.rz-dropdown-panel .rz-dropdown-item {
padding-top: 2px !important;
padding-bottom: 2px !important;
line-height: 1.2rem;
}
.rz-dropdown-panel .rz-dropdown-items {
padding-top: 0;
padding-bottom: 0;
}
/* Custom small checkbox styling */
.rz-chkbox-sm .rz-chkbox-box {
width: 16px !important;
height: 16px !important;
}
.rz-chkbox-sm .rz-chkbox-icon {
font-size: 12px !important;
line-height: 14px !important;
}
/*Headers form Datagrid*/
/* Universal Header Colors - Solid & Adaptive for chnging theme*/
.custom-ds-header {
/* Layer 1: Universal green tint | Layer 2: Theme's solid background color */
background: linear-gradient(rgba(0, 200, 80, 0.15), rgba(0, 200, 80, 0.15)), var(--rz-grid-header-background-color, #ffffff) !important;
color: #00c850 !important; /* A vibrant green that works on light and dark */
}
.custom-ns-header {
/* Layer 1: Universal blue tint | Layer 2: Theme's solid background color */
background: linear-gradient(rgba(0, 180, 216, 0.15), rgba(0, 180, 216, 0.15)), var(--rz-grid-header-background-color, #ffffff) !important;
color: #00b4d8 !important; /* A clean cyan/blue */
}
.custom-zm-header {
/* Layer 1: Universal red tint | Layer 2: Theme's solid background color */
background: linear-gradient(rgba(239, 71, 111, 0.15), rgba(239, 71, 111, 0.15)), var(--rz-grid-header-background-color, #ffffff) !important;
color: #ef476f !important; /* A punchy red/coral */
}
/* Force Radzen to respect the sticky z-index stack layout */
.rz-grid-table thead th {
z-index: 2 !important;
}
.red-bold-numeric .rz-inputtext {
color: red !important;
font-weight: bold !important;
}
/* Divider between menu items */
hr.menu-divider {
border: none;
border-top: 1px solid var(--rz-border-color, #ccc);
margin: 0.5rem 0;
}