hadimtn
دوشنبه 26 بهمن 1394, 05:53 صبح
سلام...
با استفاده از متد زیر سطرهای DataGridView رو یکی در میان رنگ میکنم اما برای بار اول اجرا (Form_Load) رنگ زنی انجام نمیشه!
public static void DataGridViewColoring(DataGridView d)
{
int X = 1;
foreach (DataGridViewRow dr in d.Rows)
{
if (X % 2 == 0)
{
dr.DefaultCellStyle.BackColor = Color.Beige;
}
else
{
dr.DefaultCellStyle.BackColor = Color.Bisque;
}
X++;
}
}
با استفاده از متد زیر سطرهای DataGridView رو یکی در میان رنگ میکنم اما برای بار اول اجرا (Form_Load) رنگ زنی انجام نمیشه!
public static void DataGridViewColoring(DataGridView d)
{
int X = 1;
foreach (DataGridViewRow dr in d.Rows)
{
if (X % 2 == 0)
{
dr.DefaultCellStyle.BackColor = Color.Beige;
}
else
{
dr.DefaultCellStyle.BackColor = Color.Bisque;
}
X++;
}
}