It is most definitely not using the HTML tags. I am certainly hitting the OnExportCellFormatting as I stated in the header of this post. Please review the screen shot to see what the header text DOES look like as compared to what the actual value is from the IDE at run time. I've put a watch in the IDE so you can see the headertext value for the column. (Ie. "11/2013</br>Actual").
Also if you look at this code snippet I can change the HeaderText value on the export but it has no effect on the resultant excel file. I have a watch on the HeaderText and it gets changed after that line is executed. It becomes "Your Custom Text". So the real question here is.. and it's my original question. How do I change the HeaderText value of a column while inside the OnExportCellFormatting event? Can this be done.
protected void radGrid1_OnExportCellFormatting(object sender, ExportCellFormattingEventArgs e)
//TODO: trying to this to see if it will allow me to changed the headertext of the column
radGrid1.ExportSettings.IgnorePaging = true;
var numStyles = NumberStyles.AllowParentheses | NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands;
var cellValue = string.Empty;
var item = e.Cell.Parent as GridDataItem;
//TODO: this align does not work //// use headerSTYLE
//e.FormattedColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
if (e.FormattedColumn.UniqueName.Length > 3)
if ((e.FormattedColumn.UniqueName.Substring(0, 4) == "Plan") &&
(e.FormattedColumn.UniqueName.Substring(0, 6) != "Plan C")
|| (e.FormattedColumn.UniqueName.Substring(0, 4) == "Actu"))
e.FormattedColumn.HeaderStyle.Width = Unit.Point(27);
var currentColumnName = e.FormattedColumn.UniqueName.ToString();
radGrid1.MasterTableView.GetColumn(currentColumnName).HeaderText = "Your Custom Text";
I have to say I tire of Telerik's support. It's always.. "send me an example" or .. "it should" ..
I've given you the entire code before only to be told it was too complex to debug. LOL This is an EXTREMELY simple question. Can I change the headerText value of a column while inside the OnExportCellFormatting event. Also I've had other issues where I did exactly what was told and it just didn't work. To then be told "I don't know try this or this". Support here is very poor in real world cases. Your examples are always the most simplistic and I"m sorry but in the real world who writes simple stuff like that. I work for the third largest manufacturing company in the world. I gaurantee you we will never have "simple" code.