#region 加入checkBox
/// <summary>
/// 加入checkBox
/// </summary>
/// <param name="datagridview"></param>
private void chekBox(DataGridView datagridview)
{
DataGridViewCheckBoxColumn newColumn = new DataGridViewCheckBoxColumn();//添加CHECKBOX
newColumn.HeaderText = "选择";
datagridview.Columns.Insert(, newColumn);
datagridview.MultiSelect = true;
newColumn.InheritedStyle.Alignment = DataGridViewContentAlignment.TopCenter;
newColumn.Width = ;
datagridview.VirtualMode = false;
}
#endregion
//dataGrvieCheckBox是否全选
private void dataGrviesCheckBoxIsFT(CheckBox checkbox, DataGridView datagridview)
{
if (checkbox.Checked == true)
{
if (datagridview.Rows.Count > )
{
for (int i = ; i < datagridview.Rows.Count; i++)
{
((DataGridViewCheckBoxCell)datagridview.Rows[i].Cells[]).Value = true;
}
}
}
else
{
if (datagridview.Rows.Count > )
{
for (int i = ; i < datagridview.Rows.Count; i++)
{
((DataGridViewCheckBoxCell)datagridview.Rows[i].Cells[]).Value = false;
}
}
}
}
//选中删除的记录
private void button15_Click(object sender, EventArgs e)
{
if (dataFssb.Rows.Count > )
{
for (int i = ; i < dataFssb.Rows.Count; i++)
{
string _selectValue = dataFssb.Rows[i].Cells[].EditedFormattedValue.ToString();
if (_selectValue == "True")
{
//MessageBox.Show(dataGridView2.Rows[i].Cells["fsmx_no"].Value.ToString());
sqlhelpers.ExecuteNonQuery("delete from dxpt_Fsmx where fsmx_no=" + dataFssb.Rows[i].Cells["fsmx_no1"].Value.ToString() + "");
}
}
}
this.dataFssb.DataSource = sqlhelpers.datatable("select rwlb,wczt,zdsjhm,fsnr,cjsj,cgsj,fsmx_no from dxpt_fsmx where wczt='发送失败'");
}