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