protected override void OnRowCreated(GridViewRowEventArgs e) { base.OnRowCreated(e); //Colors charts - see http://www.1netcentral.com/color-chart.html string onmouseoverStyle = "this.style.backgroundColor='#0bf'"; // Deepskyblue string onmouseoutStyle = "this.style.backgroundColor='@BackColor'"; string rowBackColor = String.Empty; if (e.Row.RowType == DataControlRowType.DataRow) { if (e.Row.RowState == DataControlRowState.Alternate) rowBackColor = System.Drawing.ColorTranslator.ToHtml(this.AlternatingRowStyle.BackColor).ToString(); else rowBackColor = System.Drawing.ColorTranslator.ToHtml(this.RowStyle.BackColor).ToString(); e.Row.Attributes.Add("onmouseover", onmouseoverStyle); e.Row.Attributes.Add("onmouseout", onmouseoutStyle.Replace("@BackColor", rowBackColor)); } }To be able to pick up HighlightCurrentRecordColor property.
>public class MyTextBox : TextBox >{ > private string m_MyProperty; > > public MyTextBox > { > this.m_MyProperty = ""; > } > > [DefaultValue("")] > public string MyProperty > { > get {return this.m_MyProperty;} > set {this.m_MyProperty = value;} > } > [DefaultValue(typeof(Color), "Window")] > public override Color BackColor > { > get {return base.BackColor;} > set {base.BackColor = value;} > } > [DefaultValue(typeof(Color), "WindowText")] > public override Color ForeColor > { > get {return base.ForeColor;} > set {base.ForeColor= value;} > } >} >>