TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dipa Ahuja
NA
3.1k
713.8k
display panel in gridview
Mar 16 2010 9:34 AM
hi.. i wnt to display panel inside gridview.
i have taken button field and commandname of it button is "EDIT" and when it is clicked that panel should be display..
this way..
<ItemTemplate>
<asp:Panel ID="pe" visible="false" runat="server">
<table class="basic" runat="server" id="tbledit" width="400" border="0">
<tr><td>Title:</td>
<td><asp:TextBox ID="txtaname" runat="server" /></td>
</tr>
<tr><td>Description:</td>
<td><asp:TextBox ID="TextBox2" runat="server" /></td>
</tr><tr><td colspan="2" align="center">
<asp:Button ID="btncreate" CssClass="btn" runat="server" Text="Create" OnClick="btncreate_Click" />
<asp:Button ID="btncancel" CssClass="btn" runat="server" Text="Cancel" OnClick="btncancel_Click" />
</td>
</tr>
</table>
</asp:Panel>
</ItemTemplate>
<asp:ButtonField ItemStyle-VerticalAlign="top" ButtonType="Button" CommandName="Edit"/>
.CS
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
int index=Convert.ToInt32(e.CommandArgument);
Panel pn = (Panel)GridView1.Rows[index].FindControl("pe");
if (e.CommandName == "Edit")
{
pn.Visible = true;
}
}
but its not working.... i means when i click on buttonfield it doesnt displaying the panel
Reply
Answers (
2
)
Listbox items and attributes
ASP.NET file transfer from local machine to another machine