Click here to Skip to main content
14,241,320 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi,
I am trying to develop a nested gridview.
I am having problem with child grid view alignment.
It should be aligned down,but it is getting aligned to the left of the same row.
please help me.

What I have tried:

ASPX code


 <div style="width: 100%; margin-top: 6px; float: left"><asp:gridview id="MyGridview" cssclass="mGridReport" pagerstyle-cssclass="pgr" emptydatatext="No Data Found" 
="" onrowdatabound="gridview_RowDataBound" alternatingrowstyle-cssclass="alt" runat="server" rowstyle-cssclass="rows" style="font-family: Arial;
                                overflow-x: scroll; width: 100%; font-size: Small; font-weight: normal; border-collapse: collapse;
                                white-space: nowrap; clear: both" class="mGridReport" datakeynames="PO.No" autogeneratecolumns="False">
                                <columns>
                                    <asp:templatefield>
                                        <itemtemplate>
                                       <%-- //--%>
                                        <asp:imagebutton runat="server" id="img_btn" imageurl="~/assets/img/arrow.png" onclick="Show_Hide_ChildGrid" commandargument="Show">                                             
                                            <asp:panel id="pnlOrders" runat="server" visible="false" style="position: relative">
                                                <asp:gridview id="gvOrders" runat="server" pagesize="5" 
="" allowpaging="true" cssclass="mGridReport" onpageindexchanging="gvOrders_PageIndexChanging" autogeneratecolumns="false">
                                                    <columns>
                                                    <asp:boundfield itemstyle-width="150px" datafield="SlNo" headertext="SlNo">
                                                    <asp:boundfield itemstyle-width="150px" datafield="ItemCode" headertext="ItemCode">
                                                    <asp:boundfield itemstyle-width="150px" datafield="ItemName" headertext="ItemName">
                                                    <asp:boundfield itemstyle-width="150px" datafield="qty" headertext="qty">
                                                    <asp:boundfield itemstyle-width="150px" datafield="Rate" headertext="Rate">                            
                                                    <asp:boundfield itemstyle-width="150px" datafield="UOMID" headertext="UOMID">
                                                    
                                                
                                            
                                        
                                        
                                   <asp:boundfield itemstyle-width="150px" datafield="SlNo" headertext="SlNo">
                                   <asp:boundfield itemstyle-width="150px" datafield="PO.No" headertext="PO.No">                        
                                   <asp:boundfield itemstyle-width="150px" datafield="PO.Date" headertext="PO.Date">    
                                   <asp:boundfield itemstyle-width="150px" datafield="Party Name" headertext="Party Name">    
                                   <asp:boundfield itemstyle-width="150px" datafield="Ord.Qty" headertext="Ord.Qty">    
                                   <asp:boundfield itemstyle-width="150px" datafield="Rec.Qty" headertext="Rec.Qty">    
                                   <asp:boundfield itemstyle-width="150px" datafield="Value" headertext="Value">    
                                   <asp:boundfield itemstyle-width="150px" datafield="Status" headertext="Status">
                                
                            
                        </div>

Jquery code

 $("[src*=arrow]").live("click", function () {
            debugger;
            //$('ContentPlaceHolder1_MyGridview_pnlOrders').show();
            //$(this).closest("tr").after("" + "")
            //$(this).attr("src", "images/minus.png");
        });
Posted
Updated 5-Jun-19 5:17am
v4
Comments
Vinod Jangle 4-Jun-19 6:23am
   
Your control placed on the left as you used "position: relative" for pnlOrders.
Set the correct value per your need you can find more details on -

https://www.w3schools.com/cssref/pr_class_position.asp

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100