Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editable Dropdown Question

Status
Not open for further replies.

ietprofessional

Programmer
Apr 1, 2004
267
US
Hi Everyone,

I've read this article on creating an editable dropdownlist:


FYI: I have framework 1.1 and vs.net 2003.

I've did everything the article said to do but I keep getting the data without the comboboxes.

Here are the steps I took.

1. I downloaded the files and unzipped them into my directory.

2. I added the control (dll) to my menu so that I could easily add the control to my page.

3. Added the control to my form.
Code:
<%@ Register TagPrefix="cc1" Namespace="ProgStudios.WebControls" Assembly="ProgStudios.WebControls" %>
...
<cc1:ComboBox id="ComboBox1" runat="server" DataSource="<%# dataView1 %>" DataValueField="accountnameid" DataTextField="accountname" /></TD>

3. I added the code to automatically fill the dropdown.
Code:
        Protected dataView1 As DataView
        Dim sqlConn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("SQLServer"))
        Dim ds As DataSet = New DataSet

        sqlConn.Open()

        Dim objCmd As SqlCommand = New SqlCommand("getAccountNames", sqlConn)
        Dim adapter As SqlDataAdapter = New SqlDataAdapter(objCmd)
        objCmd.CommandType = CommandType.StoredProcedure

        adapter.Fill(ds)

        dataView1 = New DataView(ds.Tables(0))
        ComboBox1.DataBind()

4. Put the combobox.htc and images directory in my project folder.

5. Built the project.

The problem is I'm getting data but it, looks like plain text, no combobox. It actually looks like a label of the account names concatenated.

What am I doing wrong here? Can someone join me on this journey?

THANKS!
 
Hmmm without trying it all for myself it looks as though you don't set the DataSource anywhere e.g.
Code:
ComboBox1.DataSource = ...


----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Solved this.

I didn't have the directory with the images and htc file in the right place.

Cool control. tough to implement.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top