Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor RadzenDataGrid OnRowRender and OnCellRender Delegates Causing Problems

$
0
0

I am using OnRowRender and OnCellRender to get custom alternating row colors on my grids. The problem is that I'd like to centralize the code for this in a base object and these methods have to match a delegate setup by each grid. Here is my general setup.

   private void OnRowRender(RowRenderEventArgs<WaybillDumpCandidate> args)   {       evenRow = !evenRow;   }   private void OnCellRender(DataGridCellRenderEventArgs<WaybillDumpCandidate> args)   {       if (args.Column.Grid.AllowAlternatingRows)       {           if (evenRow)           {               args.Attributes.Add("style", $"background-color: aliceblue;");           }           else           {               args.Attributes.Add("style", $"background-color: lightskyblue;");           }       }   }

What I would like to do, since I'm not using the arguments passed in, is setup methods with a generic argument, or no parameters at all. Is this possible?


Viewing all articles
Browse latest Browse all 4839

Trending Articles