Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
945
Multicolumn Header Text - passing variables DataGrid
posted

So I am working with Multicolumnheaders on my DataGrid and I've come across an issue that seems very easy, yet I am not able to figure it out.  I might have spent to much time looking at the code and am just missing it by a hair.

I am trying to add an entry into the HeaderText that would use variables that are declared in the view, like "item1" or "item2", etc.

I'm using MVC and it looks something like this.

@{

string item1 = ViewBag.Item1;

string item2 = ViewBag.Item2;

}

//Datagrid coding//

column.MultiColumnHeader().HeaderText("Detail Report for Item1 ").Group(g =>........

Is there a way to get the variables item1 or item2 into the HeaderText of the Multicolumnheader?