• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 340
  • Last Modified:

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

0
brgdotnet
Asked:
brgdotnet
1 Solution
 
samtran0331Commented:
Not sure if it's the most proper way to do it, but you could try to put some br tags into the header text...

<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<br /><br /><br />">
0
 
brgdotnetAuthor Commented:
Ye old break
 tag comes to the rescue.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now