Reylin Mathew

Reylin Mathew

  • NA
  • 347
  • 75.5k

Set color through color ASCII code

Dec 27 2018 9:56 PM
if (e.Row.RowType == DataControlRowType.DataRow)
{
   string value = gvdetails.DataKeys[e.Row.RowIndex].Values[0].ToString();
   if (value == "abc")
   {   
   Color colour = ColorTranslator.FromHtml("#E7EFF2");
   e.Row.BackColor = colour; 
   //e.Row.ForeColor = System.Drawing.Color.White;
   }
 
this code is not working.how to add ascii code (color code)  in c# code.

Answers (1)