Dropdown list in windows forms
-
Hi, I am new to windows forms prog. I want to use a drop down list in windows form like they do in web forms. I tried combobox and set its dropdown style to drop down list but when i try to bind data to it from a database by setting its datasource as ad dataset, i am seeing only this in the combo box. System.Data.DataViewMember. Please help...
If you fail for the first time , call it version 1.0.
-
Hi, I am new to windows forms prog. I want to use a drop down list in windows form like they do in web forms. I tried combobox and set its dropdown style to drop down list but when i try to bind data to it from a database by setting its datasource as ad dataset, i am seeing only this in the combo box. System.Data.DataViewMember. Please help...
If you fail for the first time , call it version 1.0.
It is fine upto setting the datasource of the combo box. But Just by setting datasource, the combo doesnot understand which field of the table to be displayed. For that you have to set the DisplayMember property. The displaymember property will contain all the coulmn names of the table you have retrived in the dataset. If you want to display some property (e.g. Name) and internally use another property (e.g ID) then you can set ValueMember property as follows DisplayMember=Name; ValueMember=ID; Hope this helps. :)