Hi,
{
UltraGridColumn col = new UltraGridColumn("icon", null, ColumnType.Button, null);
col.CellStyle.BackColor = col.CellStyle.ForeColor = System.Drawing.Color.Transparent;
col.CellButtonStyle.BorderStyle = BorderStyle.None;
col.CellButtonStyle.BorderWidth = Unit.Pixel(0);
col.CellStyle.TextOverflow = TextOverflow.Ellipsis;
UltraWebGrid1.Columns.Add(col);
}
Thanks, Christian
I'd start by moving this into the IntializeLayout event.
For me, I have to set the Cell.BackColor during .InitializeRow because I have to change the color based on the data being loaded in the cell. Using .InitializeLayout would be fine, if all cells were being set to the same color, but in my case they are not. The problem only occurs when there is a PostBack caused by another event such as adding a new row to the grid, or selecting an item from another control, andthing that would cause a PostBack and refresh the screen.