Click here to Skip to main content
14,695,615 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hii
I want to add multiple combobox at particular row in DataGrid.
I'm facing the following problems:

  1. While adding new combbox to the datagrid, it adds combobox to the next row and not the same row as of existing combobox.
  2. Or sometimes..
  3. Only first Combobox is displayed, for second column it show on text box

Is there any wrong code i typed..

here is code.
private void Form3_Load(object sender, EventArgs e)
{
    DataGridViewComboBoxColumn ColumnYear = new DataGridViewComboBoxColumn();
    ColumnYear.HeaderText = "Year";
    ColumnYear.DataPropertyName = "Year";
    dataGridViewComboTrial.Columns.Add(ColumnYear);

    DataGridViewComboBoxColumn ColumnMonth = new DataGridViewComboBoxColumn();
    ColumnMonth.HeaderText = "Month";
    ColumnMonth.DataPropertyName = "Month";
    dataGridViewComboTrial.Columns.Add(ColumnMonth);            
}
Posted
Updated 27-Mar-12 22:18pm
v4
Comments
Maciej Los 28-Mar-12 10:41am
   
Have you looking for the answers at THIS site?

1 solution

I guess you should be using the item templates and design the columns.That would resolve the problem you are facing.
   

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