/// <summary> /// Three functions: /// <list type="n"> /// <item>Modify Column Headings from run-on camel-case into space-seperated text.</item> /// <item>Inject the original heading text as CSS class attributes into corresponding /// data cells.</item> /// </list> /// </summary> /// <param name="sender">this GridView</param> /// <param name="gvre">A Reference to the new Row. These are categorzied by /// Header, DataRow, and Footer.</param> protected void OnRowCreated(object sender, GridViewRowEventArgs gvre) { if (gvre.Row.RowType == DataControlRowType.Header) { _columnClasses = new string[gvre.Row.Cells.Count]; int index = 0; foreach (TableCell cell in gvre.Row.Cells) { _columnClasses[index] = cell.Text; cell.Text = StringFunction.CamelCaseToDelimitted(cell.Text).Trim(); index++; } } else if (gvre.Row.RowType == DataControlRowType.DataRow) { // Inject the Column's Style (referenced as a CSS class) // into the Data Cell. for (int i = 0; i < gvre.Row.Cells.Count; i++) { TableCell cell = gvre.Row.Cells[i]; cell.CssClass = _columnClasses[i]; } } }