111,120
社区成员
发帖
与我相关
我的任务
分享
void dgvRemaindList_DataSourceChanged(object sender, EventArgs e)
{
for (int i = 0; i < dgvRemaindList.Rows.Count; i++)
{
MyDataGridViewCell MyCell = dgvRemaindList.Rows[i].Cells["MyTp"] as MyDataGridViewCell;
object value = dgvRemaindList.Rows[i].Cells["Tp"].Value;
if (value != null && value as string != "")
{
string strTP = value.ToString();
string[] tps = strTP.Split(',');
foreach (string str in tps)
{
int position = str.ToInt();
//判断牙位段
if (position > 10 && position < 20)
{
MyCell.ValueText1 += position.ToString().Remove(0, 1);
}
if (position > 20 && position < 30)
{
MyCell.ValueText2 += position.ToString().Remove(0, 1);
}
if (position > 30 && position < 40)
{
MyCell.ValueText3 += position.ToString().Remove(0, 1);
}
if (position > 40)
{
MyCell.ValueText4 += position.ToString().Remove(0, 1);
}
if (position == 30)
{
MyCell.ValueText2 += "上颌";
}
if (position == 60)
{
MyCell.ValueText3 += "下颌";
}
}
}
}
}
