I have the following code in the " radGrid1_OnInfrastructureExporting" method:
foreach (Cell cell in e.ExportStructure.Tables[0].Columns[1].Cells) { var count = 0.00; count++; var numStyles = NumberStyles.AllowParentheses | NumberStyles.AllowThousands | NumberStyles.AllowDecimalPoint; var cellValue = string.Empty; cellValue = cell.Text; cellValue = cellValue.Replace("<b>", "").Replace("</b>", "").Replace("--", "").Replace(" ", ""); cell.Value = cellValue; var outCellValue = 0.00; var isNumeric = double.TryParse("cellValue", out outCellValue); var isEmptyOrNull = string.IsNullOrEmpty(cellValue); var isText = !isNumeric && !string.IsNullOrEmpty(cellValue) ? true : false; //if (cellValue.Length >0 && !) if (!isText && !isEmptyOrNull) { cellValue = Double.Parse(cellValue, numStyles).ToString(); cell.Value = GetLocalizedValueForExcelExport(Convert.ToDouble(cellValue)); } }
Now I know i have columns[1].Cells so i'm only touching one column but for the life of me I cannot seem to get at all the columns in the grid?
If I type the following into a watch at run time I get:
e.ExportStructure.Tables[0].Columns.Count = 1
So this should be a simple fix. How can I iterate all columns.
Every way that I have tried to get access to all columns in the OnInfrastructureExporting has failed?
thanks
