void SetGridViewStyle()
{ dataGridView1.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
int rightZeroCounts, firstNotZeroNum, padCount;
foreach (DataGridViewRow dgvr in dataGridView1.Rows)
{
rightZeroCounts = GetRightZeroCounts(CommonFunc.GetDbInt(dgvr.Cells[0].Value), out firstNotZeroNum);
if (rightZeroCounts == 2) padCount = 50;
else if (rightZeroCounts == 3) padCount = 30;
else padCount = 70;
Padding pad = new Padding(padCount, 0, 0, 0);
dgvr.Cells[1].Style.Padding = pad;
}
dataGridView1.Columns[3].DefaultCellStyle.BackColor = Color.AliceBlue;
}
{ dataGridView1.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
int rightZeroCounts, firstNotZeroNum, padCount;
foreach (DataGridViewRow dgvr in dataGridView1.Rows)
{
rightZeroCounts = GetRightZeroCounts(CommonFunc.GetDbInt(dgvr.Cells[0].Value), out firstNotZeroNum);
if (rightZeroCounts == 2) padCount = 50;
else if (rightZeroCounts == 3) padCount = 30;
else padCount = 70;
Padding pad = new Padding(padCount, 0, 0, 0);
dgvr.Cells[1].Style.Padding = pad;
}
dataGridView1.Columns[3].DefaultCellStyle.BackColor = Color.AliceBlue;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货