try abc

try abc

  • 1.3k
  • 306
  • 481k

Problem in adding different CellType in single column in DataGridView Control ..

Dec 18 2007 7:16 AM
    Hello all, I am Using One grid  with Three column and I want to add Diffrent Cell type in Same Column.. I can display properly with the error. code is as bel;ow..


            dgvUserSettings.Rows.Add(5);
            dgvUserSettings.Rows[0].Cells[0].Value = "User :";
            dgvUserSettings.Rows[1].Cells[0].Value = "Level :";
            dgvUserSettings.Rows[2].Cells[0].Value = "Authority:";
            dgvUserSettings.Rows[3].Cells[0].Value = "Enable PO :";
            dgvUserSettings.Rows[4].Cells[0].Value = "Unit Cost :";



           dgvUserSettings.Rows[0].Cells[1] = new DataGridViewCheckBoxCell();
           dgvUserSettings.Rows[1].Cells[1] = new DataGridViewComboBoxCell();
           dgvUserSettings.Rows[2].Cells[1]= new DataGridViewTextBoxCell();
           dgvUserSettings.Rows[3].Cells[1] = new DataGridViewCheckBoxCell();
           dgvUserSettings.Rows[4].Cells[1] = new DataGridViewCheckBoxCell();
          


It give the foolowing error..
"system.FormatException Formateed value of the cell has a wrong value type"


If anyone knows about it.. plz help..