var a = from p in db.tbl_Date select p.day; DataGridViewComboBoxColumn dgvCmb = new DataGridViewComboBoxColumn(); dataGridView1.Columns.Add("Name", "myName"); dataGridView1.Columns.Add("Numbers", "myNumbers"); dataGridView1.Columns.Add("price", "Myprice"); dataGridView1.Columns.Add(dgvCmb); dgvCmb.DataSource = a;
dgvCmb.DataSource = a.ToArray();
<pre lang="HTML">// bind it dgvCmb.DataSource = a.ToList(); Else foreach(var result in a) { dgvCmb.items.Add(result); }
DataGridViewComboBoxColumn dgvCmb = new DataGridViewComboBoxColumn(); dgvCmb.Datasource = dt;//data table dgvCmb.DisplayMember = "column1";//column to display dgvCmb.ValueMember = "column2";//id column dataGridView1.Columns.Add(dgvCmb, "myName");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)