Hi, I'm trying to assign a dateTimePicker control to the datagridview cell as shown in this image:
I find a solution similar to this problem in this site: http://www.c-sharpcorner.com/UploadFile/0f68f2/embedding-calendar-datetimepicker-control-into-datagridvie586/
But in this proposal it uses this slice of code to assign control:
- oDateTimePicker = new DateTimePicker();
-
-
- dataGridView1.Controls.Add(oDateTimePicker);
While I use a datagridview linked with a database and makes a datatable path
-
- ListeSeance = BLL.BLSeance.GetDateseance(numerofiche);
- datagridview.ColumnCount = ListeSeance.dt.Rows.Count;
- for (int k = 0; k < ListeSeance.dt.Rows.Count; k++)
- {
-
- datagridview.Rows[0].Cells[k].Value = ListeSeance.dt.Rows[k][0].ToString();
- }
Datagridview.Rows [0] .Cells [i] .Value = oDateTimePicker displays an error. is there a solution ?