Created
July 3, 2014 11:54
-
-
Save arijusg/3049beba72ddf80ccbf4 to your computer and use it in GitHub Desktop.
Nested GridView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<asp:TemplateField HeaderText="More =>"> | |
<ItemTemplate> | |
<asp:ImageButton ID="imgBtnExpand" runat="server" CommandName="Expand" | |
CommandArgument='<%# ((GridViewRow) Container).RowIndex %>' ImageUrl="~/images/expand_button.png" /> | |
</ItemTemplate> | |
</asp:TemplateField> | |
<asp:TemplateField> | |
<ItemTemplate> | |
</td></tr> | |
<tr> | |
<td colspan="100%"> | |
<asp:Panel ID="pnlJobList" runat="server" Visible="false" Style="position: relative; left: 25px;" ViewStateMode="Enabled"> | |
asd;sdlfdjfgdsfhgldfhgldfsjhg | |
</asp:Panel> | |
</td> | |
</tr> | |
</ItemTemplate> | |
</asp:TemplateField> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void gvTotalStatistics_OnRowCommand(object sender, GridViewCommandEventArgs e) | |
{ | |
if(e.CommandName != "Expand") return; | |
var imgBtn = (ImageButton)gvTotalStatistics.Rows[Convert.ToInt32(e.CommandArgument)].FindControl("imgBtnExpand"); | |
var pnl = (Panel)gvTotalStatistics.Rows[Convert.ToInt32(e.CommandArgument)].FindControl("pnlJobList"); | |
if (pnl.Visible) | |
{ | |
pnl.Visible = false; | |
imgBtn.ImageUrl = "~/Images/expand_button.png"; | |
} | |
else | |
{ | |
pnl.Visible = true; | |
imgBtn.ImageUrl = "~/Images/expand_button_down.png"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment