如何在单击“链接”按钮时在所选GridviewRow下添加新面板。 [英] How to add new panel under selected GridviewRow on clicking Linkbutton.?

查看:78
本文介绍了如何在单击“链接”按钮时在所选GridviewRow下添加新面板。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有简单学生信息的gridview。

这个gridview有一列链接按钮,它生成Grid_rowcommand方法()。

但是当我点击那个链接按钮,我需要在所选行的正下方只有一个文本框,我可以在其中写一些文本,并可以将此回复作为电子邮件发送给perticaular学生。

I m having a gridview with simple student information.
This gridview having a column of link button which generates Grid_rowcommand method().
But when I click on that link button, i need to have a row right under the selected row only with Textbox in which i can write some text and can send this reply as email to perticaular student.

<asp:GridView ID="grdSuggestion" runat="server" AutoGenerateColumns="false" DataKeyNames=""

                    AllowPaging="True" PageSize="10" Width="100%"

                    onrowdatabound="grdSuggestion_RowDataBound"

                    onrowcommand="grdSuggestion_RowCommand" >
                    <HeaderStyle HorizontalAlign="Center" CssClass="GridHeaderClass" />
                    <PagerStyle BackColor="#3B5998" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle HorizontalAlign="Left" CssClass="GridRowClass" />
                    <EditRowStyle BackColor="#999999" />
                    <AlternatingRowStyle CssClass="GridalternetRowClass" ForeColor="#284775" />
                    <FooterStyle CssClass="GridFooterClass" />
                    <Columns>

                        <asp:TemplateField HeaderText="Faculty" ItemStyle-Width="10%">
                            <ItemTemplate>
                                <asp:Label ID="lblfaculty" runat="server" Text='<%# Eval("faculty") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Time" ItemStyle-Width="10%">
                            <ItemTemplate>
                                <asp:Label ID="lbltime" runat="server" Text='<%# Eval("time") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Course" ItemStyle-Width="15%">
                            <ItemTemplate>
                                <asp:Label ID="lblcourse" runat="server" Text='<%# Eval("coursename") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Student" ItemStyle-Width="12%">
                            <ItemTemplate>
                                <asp:Label ID="lblStudname" runat="server" Text='<%# Eval("name") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
<asp:TemplateField HeaderText="Solution" ItemStyle-Width="15%">
                            <ItemTemplate>
                              <asp:LinkButton ID="lnkReply" runat="server" Text="Reply" CommandName="Reply"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>









编码方:









coding side :


protected void grdSuggestion_RowCommand(object sender, GridViewCommandEventArgs e)
   {
       GridViewRow gvRow = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
       int RowIndex = gvRow.RowIndex;
       if (e.CommandName == "Reply")
       {
           ///Need Code Here to show Dynamic data panel
       }
   }

推荐答案

这篇关于如何在单击“链接”按钮时在所选GridviewRow下添加新面板。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆