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?
Thanks for the simple reminder. I knew it was something that I was just missing. String.Format() strikes again!
Hello Ryan,
Thank you for contacting Infragistics. You would just be able to put your string into the header text property. For example:
column.For(x => x.Name).HeaderText(item2).DataType("string");
When I test this the text I put into the string item2 is displayed in the header of the column.
Please let me know if you have any further questions concerning this matter.