Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
6
Reply
gridview OnRowCommand edit update row in c#
Devendra Kumar
Jan 17 2017 6:33 AM
350
Reply
inside grid view row command on row command edit update
i want when edit button click then edit button hide and save button visible true
<asp:TemplateField HeaderText="Edit">
<EditItemTemplate>
<asp:LinkButton ID="save" runat="server" CommandName="save1" Text="save" CommandArgument='<%# Eval("orderId") %>'></asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="edit" runat="server" CommandName="edit1" Text="edit"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
and code
protected void GridClose_RowCommand(object sender,
GridViewCommandEventArgs
e)
{
if (e.
CommandName
==
"edit1"
)
{
GridViewRow
row = (
GridViewRow
)(((Control)e.CommandSource).NamingContainer);
TextBox
txt_tracking_num = row.FindControl(
"txt_tracking_num"
)
as
TextBox
;
DropDownList
dropdwnlist = row.FindControl(
"dropdwnlist"
)
as
DropDownList
;
LinkButton
lnksave = row.FindControl(
"save"
)
as
LinkButton
;
LinkButton
edit = row.FindControl(
"edit"
)
as
LinkButton
;
txt_tracking_num.Visible =
true
;
dropdwnlist.Visible =
true
;
lnksave.Visible =
true
;
}
lnksave.Visible =
true
;
this is not valid show in error
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
6
)
Next Recommended Forum
web method is not working 404 not found
How To create multiple pdf generate??