Link to home
Create AccountLog in
Avatar of KavyaVS
KavyaVS

asked on

Editable Drop down list in Asp.Net Web Application

Hi,
I want editable dropdown list in Asp.Net C# web application.I tried this.
<ajaxToolkit:ComboBox ID="ComboBox1" runat="server"
                                                                       AutoPostBack="False"
                                                                       DropDownStyle="DropDownList"
                                                                        AutoCompleteMode="SuggestAppend"
                                                                        CaseSensitive="False"
                                                                        CssClass=""
                                                                        ItemInsertLocation="Append" ...>


I added AjaxControlToolkit.dll in the bin folder and I added the following line in my Master page.
      <AjaxControl:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </AjaxControl:ToolkitScriptManager>


But it is not working. The error is server tag is not well formed.
Is there any suggestion.

Thanks
SOLUTION
Avatar of Jerry Miller
Jerry Miller
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of KavyaVS
KavyaVS

ASKER

Now I used this and it is working. I am loading it with the Data.
  <AjaxControl:ComboBox ID="ComboBox1" runat="server"
                                                                    AutoPostBack="False"
                                                                    DropDownStyle="DropDownList"
                                                                    AutoCompleteMode="SuggestAppend"
                                                                    CaseSensitive="False"
                                                                     CssClass=""
                                                                     ItemInsertLocation="Append"/>
I am passing the Ajax ComboBox to db class and loading it with the dataset in the finally clause.
  finally
            {
                PopulateList((AjaxControlToolkit.ComboBox)objControlToLoadList, SQLSet.Tables[0]);
                                sReturnValue = "Loaded";
            }

 private void PopulateList(AjaxControlToolkit.ComboBox drpLst, DataTable SQLDt)
        {
            if (SQLDt.Rows.Count > 0)
            {
                DataView dv = new DataView(SQLDt);
             
                drpLst.DataSource = dv;
                drpLst.DataValueField = "ValueField";
                drpLst.DataTextField = "TextField";
                drpLst.DataBind();
            }
        }

Is it ok or any suggestions for loading it with the data and declaring it in the aspx page.
Thanks
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of KavyaVS

ASKER

Thanks