Required Field Validator for drop down list reading from Database
Posted on 2009-04-20
Hi im trying to use Visual studios required field validator for a drop down list. I want the first selection to be "please select" and if this is selected then the required field validaor will be displayed. t works fine if I just manually added values and had the first value equal to blank.
I am reading the values in the drop down however From a SQL Server database table. It contains 2 columns: one for the ID and one for the value. I've tried adding in a blank row
In both the load and unload and it still doesn't add the row for me.
i.e. ddlNonProductiveCategoryID.Items.Insert(0, "asdas") and i've also tried adding it using the wizzard for editing items but any item I add doesn't get displayed only the values in the database.
I know once I can get the row 'please select' added and set it's selectedvalue to blank then I can set it's selected value to blank