|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
add a list item to a bound control?Hi,
I have a drop down list thats bound to a SQL query. But I want to have the top item or .SelectedItem to be a generic "Please Select..." with no value. I've searched for the answer and tried every combination and can't find an answer. I've tried adding <ASP:ListItem> to the control but the bound data overides it. I'm using .NET with VB, Any suggestions? jr***@blackstaronline.net wrote:
> Hi, Don't bind the object to the SQL. Just loop through the sql and add the > > I have a drop down list thats bound to a SQL query. But I want to have > the top item or .SelectedItem to be a generic "Please Select..." with > no value. I've searched for the answer and tried every combination and > can't find an answer. > > I've tried adding <ASP:ListItem> to the control but the bound data > overides it. > > I'm using .NET with VB, Any suggestions? > items in yourself. That way you'll can add your item at the top. Chris Thanks Chris,
Actually I figured it out and it seems for this instance a little easier than looping through the results. All I had to do was add this one line after I bound the data to the control. mydropdown.Items.Insert(0,New ListItem("Please Select...",""))
HttpWebRequest
Using Rich Text Box - make a line bold Beginners problem with multiple forms Combobox and Values - Help Please inheritence Using Word for RTF files creation to use with RichTextBox Defaullt Printer.... Regex help needed Problem Downloading PDF with HTTPWebRequesst TopMost Form within a .net application |
|||||||||||||||||||||||