Click here to Skip to main content
15,887,386 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<asp:TemplateField  HeaderText="">
               <ItemTemplate>
              <asp:DropDownList ID="ddchapter" class="dropdown" AutoPostBack="true"  runat="server"></asp:DropDownList>
               </ItemTemplate>
              </asp:TemplateField>


What I have tried:

I am trying to insert from gridview, my dropdown item have more than 50 so I need to like combobox adding text for filters.
$('#<%dropDownVal.ClientID%>') this jQuery is works in dropdown from outside of gridview, I need from gridview 
Posted
Updated 27-Aug-20 5:12am
Comments
F-ES Sitecore 27-Aug-20 11:09am    
Please don't repost questions, people will add solutions to your question over time.

1 solution

Based on above, looks you are struggling to have a handle on dropdown inside Grid via jQuery/JavaScript.
For ASP.NET, you would have something like:
ASP.NET
<asp:TemplateField HeaderText="Country" ItemStyle-Width="150">
    <ItemTemplate>
        <%# Eval("Country") %>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:DropDownList ID="ddlCountries" runat="server">
            <asp:ListItem Text="Please select" Value="" />
            <asp:ListItem Text="United States" Value="United States" />
            <asp:ListItem Text="India" Value="India" />
            <asp:ListItem Text="France" Value="France" />
            <asp:ListItem Text="Russia" Value="Russia" />
        </asp:DropDownList>
    </EditItemTemplate>
</asp:TemplateField>

Following references will help you move:
Find and validate TextBox and DropDownList controls in GridView row using jQuery in ASP.Net[^]
How to get Dropdown selected value inside GridView using JavascriptEverything Technical[^]
JQuery: Fill DropDown and Show Records in GridView Format in ASP.Net[^]

Try out, they are with complete examples.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900