AspxGridView在cell内显示颜色
protected void master_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e) { if (e.DataColumn.FieldName == "RGB值") { colors = e.CellValue.ToString(); } if (e.DataColumn.FieldName == "颜色参照") { var cc = colors.Split(','); if (cc.Count() == 3) { try { byte R = Convert.ToByte(cc[0]); byte G = Convert.ToByte(cc[1]); byte B = Convert.ToByte(cc[2]); Color endcolor = Color.FromArgb(R, G, B); e.Cell.BackColor = endcolor; } catch (Exception we) { } } } }
年轻过得闲,以后被人嫌...
年轻累不死....