Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello all.
i want fill my combo box by header in datagreadview.

for example:
if (count columns in datagridview<>0)
fill mycombobox=columns[i].header;
Posted
Comments
Sandeep Mewara 7-May-12 12:09pm    
This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information

1 solution

C#
foreach (DataGridViewColumn column in MyDataGridView.Columns)
{
    MyCombo.Items.Add(column.HeaderText);
}
 
Share this answer
 

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