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. Gridview template field. I have to click Update twice for edit mode. how can i make it work with single click?

Gridview template field. I have to click Update twice for edit mode. how can i make it work with single click?

Scheduled Pinned Locked Moved ASP.NET
questionsysadminannouncement
4 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.
  • D Offline
    D Offline
    Dong Kim
    wrote on last edited by
    #1

    I have gridview for update by template field. Update activate with click twice. How can i make it work with single click? This is coding .aspx -> <asp:BoundField DataField="ITM_MGRP" HeaderText="M-Grp" ReadOnly="True" /> <asp:BoundField DataField="ITM_SGRP" HeaderText="S-Grp" ReadOnly="True" /> <asp:BoundField DataField="POD_ITEMID" HeaderText="ID" ReadOnly="True" /> <asp:BoundField DataField="ITM_DESCIP" HeaderText="Description" ReadOnly="True" /> <asp:BoundField DataField="IVD_UPC" HeaderText="UPC" ReadOnly="True"><HeaderStyle Width="0px" /><ItemStyle Width="0px" /></asp:BoundField> <asp:BoundField DataField="POD_UNIT" HeaderText="Unit" ReadOnly="True" /> <asp:BoundField DataField="POD_QTY" HeaderText="Ord Qty" ReadOnly="True"> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Left" /> </asp:BoundField> <asp:TemplateField HeaderText="Rcv Price"> <ItemTemplate> <asp:Label ID="lRCVPRI" runat="server" Text='<%# Bind("RCVPRICE") %>' Width="40px"></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtRCVPRI" runat="server" Text='<% Bind("RCVPRICE") %>' Width="40px"></asp:TextBox> </EditItemTemplate> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Right" /> </asp:TemplateField> <asp:TemplateField HeaderText="Rcv Qty" > <ItemTemplate> <asp:Label ID="lRCVQTY" runat="server" Text='<%# Bind("RCVQTY") %>' Width="30px"></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtRCVQTY" runat="server" Text='<% Bind("RCVQTY") %>' Width="30px"></asp:TextBox> </EditItemTemplate> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Right" /> </asp:TemplateField> &l

    N 1 Reply Last reply
    0
    • D Dong Kim

      I have gridview for update by template field. Update activate with click twice. How can i make it work with single click? This is coding .aspx -> <asp:BoundField DataField="ITM_MGRP" HeaderText="M-Grp" ReadOnly="True" /> <asp:BoundField DataField="ITM_SGRP" HeaderText="S-Grp" ReadOnly="True" /> <asp:BoundField DataField="POD_ITEMID" HeaderText="ID" ReadOnly="True" /> <asp:BoundField DataField="ITM_DESCIP" HeaderText="Description" ReadOnly="True" /> <asp:BoundField DataField="IVD_UPC" HeaderText="UPC" ReadOnly="True"><HeaderStyle Width="0px" /><ItemStyle Width="0px" /></asp:BoundField> <asp:BoundField DataField="POD_UNIT" HeaderText="Unit" ReadOnly="True" /> <asp:BoundField DataField="POD_QTY" HeaderText="Ord Qty" ReadOnly="True"> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Left" /> </asp:BoundField> <asp:TemplateField HeaderText="Rcv Price"> <ItemTemplate> <asp:Label ID="lRCVPRI" runat="server" Text='<%# Bind("RCVPRICE") %>' Width="40px"></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtRCVPRI" runat="server" Text='<% Bind("RCVPRICE") %>' Width="40px"></asp:TextBox> </EditItemTemplate> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Right" /> </asp:TemplateField> <asp:TemplateField HeaderText="Rcv Qty" > <ItemTemplate> <asp:Label ID="lRCVQTY" runat="server" Text='<%# Bind("RCVQTY") %>' Width="30px"></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtRCVQTY" runat="server" Text='<% Bind("RCVQTY") %>' Width="30px"></asp:TextBox> </EditItemTemplate> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Right" /> </asp:TemplateField> &l

      N Offline
      N Offline
      N Surendra Prasad
      wrote on last edited by
      #2

      ;) In the rowEditing and rowUpdating events, call the function which will load your grid. In your above example, after setting the newEditIndex, you need to load your grid again. Surendra Prasad

      D 1 Reply Last reply
      0
      • N N Surendra Prasad

        ;) In the rowEditing and rowUpdating events, call the function which will load your grid. In your above example, after setting the newEditIndex, you need to load your grid again. Surendra Prasad

        D Offline
        D Offline
        Dong Kim
        wrote on last edited by
        #3

        How can I do that? Please let me know little more detail.

        N 1 Reply Last reply
        0
        • D Dong Kim

          How can I do that? Please let me know little more detail.

          N Offline
          N Offline
          N Surendra Prasad
          wrote on last edited by
          #4

          Assume the following is your gridview rowediting event private sub gridview_rowediting() 'this will be your code. gridview.editindex = e.neweditindex(); 'call the function which loads your data - see be :) low loadData() end sub 'This is the function which loads data in your grid. private sub loadData() query = "select * from ..." . . . gridview.datasource = dataTable gridview.databind() end sub

          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