private static void SetCellAttributes(GridViewColumn column, HtmlGenericControl cell, bool isHeaderCell) { if (!string.IsNullOrEmpty(column.Width)) { cell.Attributes["style"] = "width: " + column.Width; } if (!isHeaderCell) { var cssClassBinding = column.GetValueBinding(GridViewColumn.CssClassProperty); if (cssClassBinding != null) { cell.Attributes["class"] = cssClassBinding; } else if (!string.IsNullOrWhiteSpace(column.CssClass)) { cell.Attributes["class"] = column.CssClass; } } else { var cssClassBinding = column.GetValueBinding(GridViewColumn.HeaderCssClassProperty); if (cssClassBinding != null) { cell.Attributes["class"] = cssClassBinding; } else if (!string.IsNullOrWhiteSpace(column.HeaderCssClass)) { cell.Attributes["class"] = column.HeaderCssClass; } } }
private static void SetCellAttributes(GridViewColumn column, HtmlGenericControl cell, bool isHeaderCell) { if (!string.IsNullOrEmpty(column.Width)) { cell.Attributes["style"] = "width: " + column.Width; } if (!isHeaderCell) { var cssClassBinding = column.GetValueBinding(GridViewColumn.CssClassProperty); if (cssClassBinding != null) { cell.Attributes["class"] = cssClassBinding; } else if (!string.IsNullOrWhiteSpace(column.CssClass)) { cell.Attributes["class"] = column.CssClass; } } else { if (column.IsPropertySet(GridViewColumn.VisibleProperty)) { cell.SetValue(TableUtils.ColumnVisibleProperty, GridViewColumn.VisibleProperty.GetValue(column)); } if (column.IsPropertySet(GridViewColumn.HeaderCssClassProperty)) // transfer all bindings (even StaticValue), because column has wrong DataContext for them { cell.Attributes["class"] = column.GetValueRaw(GridViewColumn.HeaderCssClassProperty); } } }
private static void SetCellAttributes(GridViewColumn column, HtmlGenericControl cell, bool isHeaderCell) { if (!string.IsNullOrEmpty(column.Width)) { cell.Attributes["style"] = "width: " + column.Width; } if (!isHeaderCell) { var cssClassBinding = column.GetValueBinding(GridViewColumn.CssClassProperty); if (cssClassBinding != null) { cell.Attributes["class"] = cssClassBinding; } else if (!string.IsNullOrWhiteSpace(column.CssClass)) { cell.Attributes["class"] = column.CssClass; } } else { if (column.IsPropertySet(GridViewColumn.HeaderCssClassProperty)) // transfer all bindings (even StaticValue), because column has wrong DataContext for them { cell.Attributes["class"] = column.GetValueRaw(GridViewColumn.HeaderCssClassProperty); } } }
private static void SetCellAttributes(GridViewColumn column, HtmlGenericControl cell, bool isHeaderCell) { if (!string.IsNullOrEmpty(column.Width)) { cell.Attributes["style"] = "width: " + column.Width; } var cssClassBinding = column.GetValueBinding(isHeaderCell ? GridViewColumn.CssClassProperty : GridViewColumn.HeaderCssClassProperty); if (cssClassBinding != null) { cell.Attributes["class"] = cssClassBinding; } else if (!string.IsNullOrWhiteSpace(column.CssClass)) { cell.Attributes["class"] = column.CssClass; } }