How to put a line seperator between two <asp:BoundField DataField> controls.

Posted on 2009-04-22
Last Modified: 2012-06-21
Hello, I have a DetailsView control on one line, and then immediately followed by another line that has a save and cancel button. These rows are too close together and I need an empty line
so that there is a space between the data bound field and my button control. Can someone tell me how to but some type of spacer before this line of code:
             <asp:CommandField InsertText="Save" ShowEditButton="True" ButtonType="Button"  
                ShowInsertButton="True" />

The code snippet below shows this code again with the other code
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 

         DataKeyNames="TempUserID" DataSourceID="SqlDataSource1" 

        DefaultMode="Insert" Height="50px" Width="333px" GridLines="None">


            <asp:BoundField DataField="TempUserID" HeaderText="TempUserID" 

                InsertVisible="False" ReadOnly="True" SortExpression="TempUserID" />

            <asp:BoundField DataField="UserFirstName" HeaderText="First Name" 

                SortExpression="UserFirstName" />

            <asp:BoundField DataField="UserLastName" HeaderText="Last Name" 

                SortExpression="UserLastName" />

            <asp:BoundField DataField="userEmail" HeaderText="Email" 

                SortExpression="userEmail" />

             <asp:CommandField InsertText="Save" ShowEditButton="True" ButtonType="Button"  

                ShowInsertButton="True" />



Open in new window

Question by:brgdotnet
    LVL 15

    Accepted Solution

    You can use <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" /> to give a distinct color to that button row.
    Alternatively you can trick it by adding a dummy column before the command button
    LVL 2

    Author Comment

    Hi spprivate,

    Cool, the dummy column option sounds good. In html I know how to do this easily. But how would I do it using for the code above? Can you show me how?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now