Link to home
Start Free TrialLog in
Avatar of brgdotnet
brgdotnetFlag for United States of America

asked on

How do i create blank rows/lines between my header and the controls under the header?

I am working with a Details View which has a header and is then followed by fields and edit controls.
How do I place one or more blank lines between the header and the controls which are underneath the header?
Currently the controls are up to close the the header with no spacing after the header. How can I fix this?

You can drop my code into a web form to see how it looks if you wish.
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
        DataKeyNames="CourseID" DataSourceID="SqlDataSource1" DefaultMode="Insert" 
        Height="50px" Width="400px" CssClass="PagerStyle" GridLines="None" 
        HeaderText="Add A New Course"> <!-- How do I put two blank lines after this line when rendered in a browser -->
        <Fields>
            <asp:BoundField DataField="CourseID" HeaderText="CourseID" 
                InsertVisible="False" ReadOnly="True" SortExpression="CourseID" >
            <HeaderStyle CssClass="top" />
            </asp:BoundField>
            <asp:BoundField DataField="CourseTitle" HeaderText="CourseTitle" 
                SortExpression="CourseTitle" />
            <asp:TemplateField HeaderText="Course Description" 
                SortExpression="CourseDescription">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" 
                        Text='<%# Bind("CourseDescription") %>'></asp:TextBox>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Height="108px" 
                        Text='<%# Bind("CourseDescription") %>' TextMode="MultiLine" Width="183px"></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("CourseDescription") %>'></asp:Label>
                </ItemTemplate>
                <ControlStyle CssClass="field" />
                <ItemStyle VerticalAlign="Top" />
            </asp:TemplateField>
            <asp:CheckBoxField DataField="RollCall" HeaderText="RollCall" 
                SortExpression="RollCall">
            <ControlStyle CssClass="field" />
            </asp:CheckBoxField>
            <asp:CheckBoxField DataField="Email" HeaderText="Email" 
                SortExpression="Email" >
            <ControlStyle CssClass="field" />
            </asp:CheckBoxField>
            <asp:CheckBoxField DataField="SMS" HeaderText="SMS" SortExpression="SMS" >
            <ControlStyle CssClass="field" />
            </asp:CheckBoxField>
            <asp:TemplateField HeaderText="SemesterGroupID" SortExpression="SemesterGroupID">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("SemesterGroupID") %>'></asp:TextBox>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:ListBox ID="ListBox1" runat="server" DataSourceID="SqlDataSource2" 
                        DataTextField="SemesterGroupName" DataValueField="SemesterGroupID" 
                        SelectedValue='<%# Bind("SemesterGroupID") %>'></asp:ListBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("SemesterGroupID") %>'></asp:Label>
                </ItemTemplate>
                <ControlStyle CssClass="field" />
                <ItemStyle CssClass="field" />
            </asp:TemplateField>
            <asp:TemplateField SortExpression="intUserID">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("intUserID") %>'></asp:TextBox>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:DropDownList ID="DropDownList1" runat="server" 
                        DataSourceID="SqlDataSource3" DataTextField="intUserID" 
                        DataValueField="intUserID" SelectedValue='<%# Bind("intUserID") %>' 
                        Visible="False">
                    </asp:DropDownList>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("intUserID") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowInsertButton="True" InsertText="Save" ButtonType="Button" />
        </Fields>
        <HeaderStyle BackColor="#3399FF" BorderColor="#000066" CssClass="caption" 
            Font-Bold="True" Font-Size="Smaller" ForeColor="White" 
            HorizontalAlign="Center" />
        <InsertRowStyle CssClass="TOP" />
        <EditRowStyle BorderStyle="None" BorderWidth="0px" CssClass="TOP" />
    </asp:DetailsView>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of samtran0331
samtran0331
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brgdotnet

ASKER

Ye old break
 tag comes to the rescue.