Nested gridview - column alignment


  • Hi, I'm developing a web application using 2008

    I have a nested gridview with html code as below.

    It has a button at the 1st column, when clicked will trigger the script to expand the child section (which is a gridview)

    but i run into problem to align the column width of child with parent.

    Hope you all may help.

    HTML code

    <div class="GridScrollbar">

    <asp:GridView ID="ParentGridView" runat="server" CssClass="CommonGrid" RowStyle-Width ="100px"

    HeaderStyle-CssClass="SummaryGridHeader" AlternatingRowStyle-CssClass="SummaryGridAlternateItem"

    FooterStyle-CssClass ="SummaryGridFooter" RowStyle-CssClass ="SummaryGridItem" AllowPaging="False" DataKeyNames="Division" >

    <RowStyle HorizontalAlign="Right" />

    <FooterStyle HorizontalAlign="Right" />




    <img alt = "" style="cursor: pointer" src="my plus icon image here" />

    <asp:Panel Style="display: none" runat="server" >

    <asp:GridView ID="ChildGridView" runat="server" CssClass = "CommonGrid" width="100%" RowStyle-Wrap="false"

    AlternatingRowStyle-CssClass="PaleBlueGridAlternateItem" RowStyle-CssClass ="PaleBlueGridItem" AllowPaging="False" ShowFooter="false" ShowHeader = "false" RowStyle-Width ="100px"

    OnRowDataBound="ChildGridView_RowDataBound" OnRowCreated="ChildGridView_RowCreated" >

    <RowStyle HorizontalAlign="Right" />

    <FooterStyle HorizontalAlign="Right" />

    </asp:GridView> </asp:Panel>







    <script type="text/javascript" src="xxxx"></script>

    <script type="text/javascript">

    $("[src*=PlusIcon]").live("click", function() {

    this).closest("tr").after("<tr><td></td><td colspan = '99'>" + $(this).next().html() + "</td></tr>")


    this).attr("src", "minus icon here");



    "[src*=MinusIcon]").live("click", function() {

    $(this).attr("src", "Plus icon here");





    Wednesday, November 20, 2013 2:10 AM

All replies

  • Maybe you should ask in the forum:

    Best Regards,
    Please remember to mark the replies as answers if they help

    Wednesday, November 20, 2013 12:19 PM
  • Hi,

    I think the ASP.NET forum will be a better forum for you to ask this question, and you will get a good reply from there:
    #ASP.NET forum:

    Thank you for your understanding.

    Best Regards,

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, November 21, 2013 1:04 AM
  • Thank you franklin & IssueKiller,

     i was search for the related forum from MSDN forum main page, and i can't find a forum related to, hence i tried my luck here.

    Thank you for pointing out, i will post my question at forum.

    Friday, November 22, 2013 1:20 AM