Click here to Skip to main content
15,886,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi,
I have a dropdownlist and the gridview and I want to bind the dropdownlist according to the header of the grid view for filter.If i have a grid view header like
C#
productid   |  productname   |    Productcode  | edit  |  delete

the dropdown should have values like

productid
productname
Productcode
please help
Posted
Updated 4-Sep-13 1:09am
v3

C#
for (int i = 0; i < dataGridView1.ColumnCount; i++)
           {
               comboBox1.Items.Add(dataGridView1.Columns[i].HeaderText);
           }
 
Share this answer
 
Comments
Priyanka Bhagwat 4-Sep-13 7:29am    
hi,thank you for your help

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