Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6720601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:13:54+00:00 2026-05-26T09:13:54+00:00

I have a nested gridview in my page. The first one is used like

  • 0

I have a nested gridview in my page. The first one is used like a header, so this will display the segment name. The second one is used to display the segment details. Everything works great except I am having problem in styling the first grid. The way I want to display data in this page is
Segment (Line Break)
Details

But it displays as Segment Details in one row. How would I make the grids appear in two row that takes the whole width of the page. Here is how its set up currently.

<asp:GridView ID="gvSegments" runat="server" AutoGenerateColumns="false" GridLines="None" Width="900px" OnRowDataBound="gvSegments_RowDataBound">
    <Columns>
        <asp:TemplateField ShowHeader="false">
            <ControlStyle Width="140px" />
            <ItemTemplate>
                <asp:HiddenField ID="hfSegmentId" runat="server" Value='<%# Bind("SegmentId") %>' />
                <asp:Label ID="lblSegmentDesc" runat="server" Text='<%# Bind("SegmentDesc") %>' Font-Bold="true" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField ShowHeader="false">
            <ItemTemplate>
                <asp:GridView ID="gvSegmentDetails" runat="server" AutoGenerateColumns="false" GridLines="None" OnRowDataBound="gvSegmentDetails_RowDataBound" Font-Size="11px">
                    <Columns>
                        <asp:TemplateField ShowHeader="false">
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:CheckBox ID="chkAction" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Medium">
                            <ControlStyle Font-Size="11px" />
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                 <asp:HiddenField ID="hfSegmentId" runat="server" Value='<%# Bind("SegmentId") %>' />
                                 <asp:HiddenField ID="hfSegmentDetailId" runat="server" Value='<%# Bind("SegmentDetailId") %>' />
                                 <asp:Label ID="lblMediaType" runat="server" Text='<%# Bind("MediaTypeDesc") %>' />
                             </ItemTemplate>
                         </asp:TemplateField>
                         <asp:TemplateField HeaderText="Cost per Piece">
                             <ItemStyle HorizontalAlign="Center" />
                             <ItemTemplate>
                                 <asp:Label ID="lblCostPerPiece" runat="server" Text='<%# Bind("CostPerPiece") %>' />
                             </ItemTemplate>
                         </asp:TemplateField>
                         <asp:TemplateField ShowHeader="false">
                             <ItemTemplate>
                                 <asp:LinkButton ID="lnkEditMedia" runat="server" Text="Details" OnClick="lnkEditMedia_Click" />
                             </ItemTemplate>
                         </asp:TemplateField>
                         <asp:TemplateField HeaderText="Advertising Months">
                             <ControlStyle Font-Size="11px" />
                             <ItemStyle HorizontalAlign="Center" />
                             <ItemTemplate>
                                 <asp:Label ID="lblAdvertisingMonths" runat="server" Text='<%# Bind("Months") %>' />
                             </ItemTemplate>
                         </asp:TemplateField>
                         <asp:TemplateField HeaderText="Budget">
                             <ControlStyle Width="70px" Font-Size="11px" />
                             <ItemStyle HorizontalAlign="Center" />
                             <ItemTemplate>
                                 <asp:Label ID="txtBudget" runat="server" Text='<%# Bind("DropAmount", "{0:$###,###,##0.00}") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Total Quantity">
                            <ItemStyle HorizontalAlign="Center" />
                            <ControlStyle Width="50px" Font-Size="11px" />
                            <ItemTemplate>
                                <asp:Label ID="lblTotalQty" runat="server" Text='<%# Bind("DropQuantity") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Select Creative">
                            <ControlStyle Font-Size="11px" />
                            <ItemTemplate>
                                <asp:DropDownList ID="ddrCreative" runat="server" AppendDataBoundItems="true" OnSelectedIndexChanged="ddrCreative_SelectedChanged" AutoPostBack="true">
                                    <asp:ListItem Value="-1" Text="Select One" Selected="True" />
                                </asp:DropDownList>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="false">
                            <ControlStyle Font-Size="11px" />
                            <ItemTemplate>
                                <asp:HiddenField ID="hfCreativeUrl" runat="server" />
                                <asp:HyperLink ID="hprCreativeUrl" runat="server" Target="_blank" Text="Click here" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle BackColor="#a73e20" ForeColor="White" />
                    <AlternatingRowStyle BackColor="#E4E4E4" />
                    <RowStyle BackColor="#F7F7F7" />
                </asp:GridView>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:13:54+00:00Added an answer on May 26, 2026 at 9:13 am

    One way to do it (althought maybe not what you are looking for) is to put both the nested GridView in the same ItemTemplate as your other first column with a break and/or a horizontal line or something like that. It could look something like:

    <asp:GridView ID="gvSegments" runat="server">
    <Columns>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:HiddenField />
                <asp:Label />
    
                <br />
                <hr />
    
                <asp:GridView />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    </asp:GridView>
    

    Then to make the row span the entire window you can just add and ItemStyle to your TemplateField

    <asp:TemplateField ItemStyle-Width="100%">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have nested divs like this (pseudo code..) <div0> <div1></div1> <div2>fluid width</div2> <div3></div3> </div0>
I have nested repeaters like this: <asp:Repeater ID=rptQuestoes runat=server> <HeaderTemplate> <ol class=orderedList> </HeaderTemplate> <ItemTemplate>
I have nested routes like this : map.resources :foo do |foo| foo.resources :bar do
I have a radiobutton column in a gridview, inside many nested asp tables. I
Is it possible to have nested set capabilities in this somewhat custom setup? Consider
I keep finding that if I have nested divs inside each other, and one
I have two nested DropDownLists (the value selected in the 1st ddl will limit
I have a gridview and I would like to be able to programatically change
I have a Repeater nested inside of a GridView . On the RowDataBound event
I have nested grids in my views and would like to use same CSS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.