Click here to Skip to main content
15,892,199 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Actually as per customer requirement need to have dropdown ( combo box ) in last column of datagridview, User will select appropriate option as per his requirement
C#
// binding grid 
DataSet ds = new DataSet();
                ds = Common.Get_Order_Allocation_Grid(id);               

                dataGridView1.Visible = true;
                DataGridViewComboBoxColumn c = new DataGridViewComboBoxColumn();

// Binding combobox
                DataSet ds1 = new DataSet();
                {
                    ds1 = Common.GET_ALLOCATION_OPTION();
                }
                
                {
                      dataGridView1.DataSource = ds.Tables[0];
                        dataGridView1.ReadOnly = true;

                        for (i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            c.DataSource = ds1.Tables[0];
                            c.DisplayMember = "VENDOR_ID";
                            c.ValueMember = "VEN_PARTY_NAME";
                            dataGridView1.Columns.Add(c);            
                        }
                }
Posted
Updated 4-Nov-13 4:53am
v2
Comments
CHill60 4-Nov-13 10:54am    
And what is the problem?
ZurdoDev 4-Nov-13 11:27am    
What's your question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900