Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
I have a grid-view with 5 columns with edit image button in that gridview,
when we click on that edit, that gridview should be hide and then that row values of gridview open in editable mode with in that page only,
please anyone provide me the procedure to do this,
div id=div1>gridview /div
div id=div2>textboxes or gridview /div


thankyou...,
Posted
Comments
Shafeequl 14-Jun-13 2:04am    
where you put that edit image button.?against all rows in gridview? please clarify your ques..
ravikiran from Hyderabad 14-Jun-13 2:47am    
try this..........

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/HoverMenu/HoverMenu.aspx

or..

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx

consider these things

when the time you click on edit on gridrow save {ID OF ROW} to some hidden
and get those details back to popup

save directly to database and load gridview page again.

Refer to this link which shows something that you are trying to do.Here,Gridview doesnt hide but the row values would be in popup window.

Ajax ModalPopUpExtender Example to edit the gridview row values in asp.net[^]

Regards.. :laugh:
 
Share this answer
 
Hi...
In .aspx:
XML
<asp:TemplateField HeaderText="Quantity" HeaderStyle-Width="40px" >
                    <ItemTemplate>
                    <asp:Label ID="lblq" runat="server" Text='<%# bind("Quantity") %>' ></asp:Label></ItemTemplate>
                    <HeaderStyle Width="40px"></HeaderStyle>
                    <EditItemTemplate><asp:TextBox ID="txteq" runat="server" Text='<%# bind("Quantity") %>'></asp:TextBox></EditItemTemplate>
                    <FooterTemplate ><asp:TextBox ID="txtq" runat="server" ForeColor="Blue" Width="40px"></asp:TextBox></FooterTemplate>
                    </asp:TemplateField>

For rowediting(aspx.cs):
C#
protected void gv_RowEditing(object sender, GridViewEditEventArgs e)
        {
            gv.EditIndex = e.NewEditIndex;
            getdata();
        }

In rowupdating(aspx.cs):
C#
string QUAT = ((TextBox)gv.Rows[e.RowIndex].FindControl("txteq")).Text;
                int quat = Convert.ToInt32(QUAT.Trim());

and then write ur query for updating in .cs.
thanks,its may useful to u.
 
Share this answer
 

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