Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Dropdownlist while editing a gridview

Dropdownlist while editing a gridview

Scheduled Pinned Locked Moved ASP.NET
databasesysadminquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 4 Offline
    4 Offline
    4anusha4
    wrote on last edited by
    #1

    in my application when i edit a row in a gridview for a particular column i have to display a dropdownlist thats ok but when the dropdownlist is loaded i have to display the selected value as the value that is retrieved from the database how is it possible? this is the code for gridview for that particular column <asp:TemplateField HeaderText="Mandal Type" ItemStyle-Width="30%"> <ItemTemplate> <%# Eval("nMandalType") %> </ItemTemplate> <EditItemTemplate> <asp:DropDownList ID="ddlMandalType" runat="server"> <asp:ListItem Value="0">--SELECT--</asp:ListItem> <asp:ListItem Value="101" >Mandal</asp:ListItem> <asp:ListItem Value="102">Municipality</asp:ListItem> <asp:ListItem Value="103">Division</asp:ListItem> </asp:DropDownList> </EditItemTemplate> <FooterTemplate> <asp:DropDownList ID="ddlNewMandalType" runat="server"> <asp:ListItem Value="0">--SELECT--</asp:ListItem> <asp:ListItem Value="101" >Mandal</asp:ListItem> <asp:ListItem Value="102">Municipality</asp:ListItem> <asp:ListItem Value="103">Division</asp:ListItem> </asp:DropDownList> </FooterTemplate> <ItemStyle Width="30%" /> </asp:TemplateField>

    P 1 Reply Last reply
    0
    • 4 4anusha4

      in my application when i edit a row in a gridview for a particular column i have to display a dropdownlist thats ok but when the dropdownlist is loaded i have to display the selected value as the value that is retrieved from the database how is it possible? this is the code for gridview for that particular column <asp:TemplateField HeaderText="Mandal Type" ItemStyle-Width="30%"> <ItemTemplate> <%# Eval("nMandalType") %> </ItemTemplate> <EditItemTemplate> <asp:DropDownList ID="ddlMandalType" runat="server"> <asp:ListItem Value="0">--SELECT--</asp:ListItem> <asp:ListItem Value="101" >Mandal</asp:ListItem> <asp:ListItem Value="102">Municipality</asp:ListItem> <asp:ListItem Value="103">Division</asp:ListItem> </asp:DropDownList> </EditItemTemplate> <FooterTemplate> <asp:DropDownList ID="ddlNewMandalType" runat="server"> <asp:ListItem Value="0">--SELECT--</asp:ListItem> <asp:ListItem Value="101" >Mandal</asp:ListItem> <asp:ListItem Value="102">Municipality</asp:ListItem> <asp:ListItem Value="103">Division</asp:ListItem> </asp:DropDownList> </FooterTemplate> <ItemStyle Width="30%" /> </asp:TemplateField>

      P Offline
      P Offline
      padmanabhan N
      wrote on last edited by
      #2

      4anusha4 wrote:

      Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

      4 1 Reply Last reply
      0
      • P padmanabhan N

        4anusha4 wrote:

        Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

        4 Offline
        4 Offline
        4anusha4
        wrote on last edited by
        #3

        thank u it worked

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups