how to make checkbox checked=true in datagrisview

Oct 19 2008 10:44 PM
 
hi there,
i have code ,i want  the every row under header Admin are checked

private void Form1_Load(object sender, EventArgs e)
        {
            string[] ug = { "Admin", "User" };
           
                for (int i = 0; i < ug.Length; i++)
            {
                dgv1.Columns.Add(new DataGridViewCheckBoxColumn());

                dgv1.Columns[i].Name = ug[i];
                dgv1.Columns[i].HeaderText = ug[i];
                dgv1.Columns[i].Width = 100;

                if (ug[i] == "Admin")
                {
                 // I want on every row checkbox checked=true here

                }
            }
        }

thank you and best regard
hanafi

Answers (2)