public List<DataRow> SelectedRows { get; private set; }
//保存选中CheckBox的数量
int count = 0;//薪酬项名称集合
this.SelectedRows = new List<DataRow>();
for (int i = 0; i < this.totalDataGridView1.DataGrid.Rows.Count; i++)
{
//判断CheckBox是否选中
if (this.totalDataGridView1.DataGrid.Rows[i].Cells[0].EditedFormattedValue.ToString() == "True")
{
count++;
this.SelectedRows.Add(((DataRowView)this.totalDataGridView1.DataGrid.Rows[i].DataBoundItem).Row);
}
}
if (count == 0)
{
CustMessage.ShowAlertMessage("请至少选择一条数据!");
return;
}