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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. GridView Control - EditItemTemplate Controls

GridView Control - EditItemTemplate Controls

Scheduled Pinned Locked Moved ASP.NET
csssysadmindockerquestion
6 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.
  • J Offline
    J Offline
    Juvil John
    wrote on last edited by
    #1

    Hi, I have a grid, which has an ItemTemplate and an EditItemTemplate, my concern is how do I get the controls in the EditItemTemplate, my grid columns looked like this... <asp:TemplateField HeaderText="Price Type" HeaderStyle-CssClass="first" SortExpression="PriceType"> <ItemTemplate> <asp:Label ID="lbl_pricingtype" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "PriceType[0].PriceTypeDesc[0].Description")%>' ToolTip='<%# DataBinder.Eval(Container.DataItem, "PriceType[0].PriceType")%>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:DropDownList ID="ddl_pricingtype" runat="server" CssClass="first" Width="90px" onchange="ddl_pricingtype_change(this.value)"> <asp:ListItem Text="Please Select" Value="-1"></asp:ListItem> <asp:ListItem Text="0 - Price1" Value="0"></asp:ListItem> <asp:ListItem Text="1 - Price2" Value="1"></asp:ListItem> <asp:ListItem Text="2 - Price3" Value="2"></asp:ListItem> </asp:DropDownList> </EditItemTemplate> <HeaderStyle CssClass="first" /> <ItemStyle CssClass="first" /> </asp:TemplateField> Now I can get the value from the ItemTemplate label using OnRowEditing event but I can't seem to find the Dropdownlist control to set the selecteditem.

    P 1 Reply Last reply
    0
    • J Juvil John

      Hi, I have a grid, which has an ItemTemplate and an EditItemTemplate, my concern is how do I get the controls in the EditItemTemplate, my grid columns looked like this... <asp:TemplateField HeaderText="Price Type" HeaderStyle-CssClass="first" SortExpression="PriceType"> <ItemTemplate> <asp:Label ID="lbl_pricingtype" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "PriceType[0].PriceTypeDesc[0].Description")%>' ToolTip='<%# DataBinder.Eval(Container.DataItem, "PriceType[0].PriceType")%>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:DropDownList ID="ddl_pricingtype" runat="server" CssClass="first" Width="90px" onchange="ddl_pricingtype_change(this.value)"> <asp:ListItem Text="Please Select" Value="-1"></asp:ListItem> <asp:ListItem Text="0 - Price1" Value="0"></asp:ListItem> <asp:ListItem Text="1 - Price2" Value="1"></asp:ListItem> <asp:ListItem Text="2 - Price3" Value="2"></asp:ListItem> </asp:DropDownList> </EditItemTemplate> <HeaderStyle CssClass="first" /> <ItemStyle CssClass="first" /> </asp:TemplateField> Now I can get the value from the ItemTemplate label using OnRowEditing event but I can't seem to find the Dropdownlist control to set the selecteditem.

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

      refer and download from the following link : GridView all in one[^]

      Padmanabhan

      J 1 Reply Last reply
      0
      • P padmanabhan N

        refer and download from the following link : GridView all in one[^]

        Padmanabhan

        J Offline
        J Offline
        Juvil John
        wrote on last edited by
        #3

        what link?

        P 1 Reply Last reply
        0
        • J Juvil John

          what link?

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

          there is a sample program in which using EditItemTemplates are given..

          Padmanabhan

          J 1 Reply Last reply
          0
          • P padmanabhan N

            there is a sample program in which using EditItemTemplates are given..

            Padmanabhan

            J Offline
            J Offline
            Juvil John
            wrote on last edited by
            #5

            thanks dude. twas a great article.

            P 1 Reply Last reply
            0
            • J Juvil John

              thanks dude. twas a great article.

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

              its my own article.. if u like that then vote for that article...

              Padmanabhan

              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