Click here to Skip to main content
15,895,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello ,

I have one datagrid,in that datagrid ,there is one column of type DataGridViewComboBoxColumn. through designer it is possible to me add element in that combobox.But i wants to display default value in that combobox.means i want to display "select" as default value in combobox.how can i do this?

Please help!
Posted
Updated 1-Oct-12 1:10am
v2

1 solution

Try like this :

C#
ddlTest.DataSource =  DataTable;
       ddlTest.DataTextField = "ID";
       ddlTest.DataValueField = "Name";
       ddlTest.DataBind();
       ddlTest.Items.Insert(0, new ListItem("Select", "0"));
 
Share this answer
 
Comments
astika 2-Oct-12 1:31am    
Thanks for help!
same value is assigned to each combo.I want to assign different values to each combo.can u help?
solanki.net 3-Oct-12 0:09am    
then what is problem ? change your message here
ddlTest.Items.Insert(0, new ListItem("Select", "0"));

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