public Color HtmlToColor(string htmlColr)
{
int baseIndex = 1;
byte a, r, g, b;
a = r = g = b = 255;
if (htmlColr.Length == 9)
{
a = Convert.ToByte(htmlColr.Substring(baseIndex, 2), 16);
baseIndex += 2;
}
r = Convert.ToByte(htmlColr.Substring(baseIndex, 2), 16);
g = Convert.ToByte(htmlColr.Substring(baseIndex += 2, 2), 16);
b = Convert.ToByte(htmlColr.Substring(baseIndex += 2, 2), 16);
return Color.FromArgb(a, r, g, b);
}
private void dgList_LoadingRow(object sender, DataGridRowEventArgs e)
{
//Color col = ColorTranslator.FromHtml(strColor);
if (e.Row.GetIndex() == 1)
{
SolidColorBrush brush = new SolidColorBrush(HtmlToColor("#edf6fd"));
e.Row.Background = brush;
}
else
{
if (e.Row.GetIndex() != 1)
{
if (e.Row.GetIndex() / 2>0)
{
SolidColorBrush brush = new SolidColorBrush(HtmlToColor("#edf6fd"));
e.Row.Background = brush;
}
}
}
{
int baseIndex = 1;
byte a, r, g, b;
a = r = g = b = 255;
if (htmlColr.Length == 9)
{
a = Convert.ToByte(htmlColr.Substring(baseIndex, 2), 16);
baseIndex += 2;
}
r = Convert.ToByte(htmlColr.Substring(baseIndex, 2), 16);
g = Convert.ToByte(htmlColr.Substring(baseIndex += 2, 2), 16);
b = Convert.ToByte(htmlColr.Substring(baseIndex += 2, 2), 16);
return Color.FromArgb(a, r, g, b);
}
private void dgList_LoadingRow(object sender, DataGridRowEventArgs e)
{
//Color col = ColorTranslator.FromHtml(strColor);
if (e.Row.GetIndex() == 1)
{
SolidColorBrush brush = new SolidColorBrush(HtmlToColor("#edf6fd"));
e.Row.Background = brush;
}
else
{
if (e.Row.GetIndex() != 1)
{
if (e.Row.GetIndex() / 2>0)
{
SolidColorBrush brush = new SolidColorBrush(HtmlToColor("#edf6fd"));
e.Row.Background = brush;
}
}
}