private void User_Form_Load(object sender, EventArgs e)
{
winPagesImage1.ShowWhat = ShowWhat;
winPagesImage1.PageSize = Pagesize;
int allcount = 0;
winPagesImage1.NowPage = 1;
dbu.SearchUsersCompleted += new Ha_Demo.DBUser.SearchUsersCompletedEventHandler(dbu_SearchUsersCompleted);
dbu.SearchUsersAsync(Where, Field, OrderBy, Pagesize.ToString(), "1", allcount);
pictureBox1.Visible = true;
winPagesImage1.dataGridView1.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.TopLeft;
winPagesImage1.dataGridView1.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft;
System.Windows.Forms.CheckBox ckBox = new System.Windows.Forms.CheckBox();
ckBox.Text = "全选";
ckBox.Checked = false;
System.Drawing.Rectangle rect = winPagesImage1.dataGridView1.GetCellDisplayRectangle(5, -1, true);
ckBox.Size = new System.Drawing.Size(winPagesImage1.dataGridView1.Columns[5].Width, 20);
ckBox.Location = rect.Location;
ckBox.CheckedChanged += new EventHandler(ckBox_CheckedChanged);
winPagesImage1.dataGridView1.Controls.Add(ckBox);
}
void ckBox_CheckedChanged(object sender, EventArgs e)
{
for (int i = 0; i < winPagesImage1.dataGridView1.Rows.Count; i++)
{
winPagesImage1.dataGridView1.Rows[i].Cells[5].Value = ((System.Windows.Forms.CheckBox)sender).Checked;
}
winPagesImage1.dataGridView1.EndEdit();
}