<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>
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 } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)