How to increase the length of my edit boxes inside of a "DetailsView" control?

Posted on 2009-04-22
Last Modified: 2012-05-06
I have several edit boxes inside of a "DetailsView" control. Can someone tell me how I can make the edit boxes longer in length? I am not use to resizing these types of controls?

I am using .NET 3.5 with VS 2008
<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:BoundField DataField="userPhone" HeaderText="Phone" 

                SortExpression="userPhone" />

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

                SortExpression="useraltemail" />

            <asp:BoundField DataField="useraltphone" HeaderText="Phone" 

                SortExpression="useraltphone" />

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

                SortExpression="intuserPocID" />

            <asp:BoundField DataField="txtHomeAddress" HeaderText="Address" 

                SortExpression="txtHomeAddress" />

            <asp:BoundField DataField="txtHomeCity" HeaderText="City" 

                SortExpression="txtHomeCity" />

            <asp:BoundField DataField="txtHomeState" HeaderText="State" 

                SortExpression="txtHomeState" />

            <asp:BoundField DataField="txtHomeZip" HeaderText="Zip" 

                SortExpression="txtHomeZip" />

            <asp:BoundField DataField="userExpire" HeaderText="Expire Date " 

                SortExpression="userExpire" />

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

                ShowInsertButton="True" />



Open in new window

Question by:brgdotnet
    LVL 39

    Accepted Solution

    Look at the following example, that explains it all, doesn't it? The control-style is for the internal edit box.

    <asp:DetailsView runat="server" ID="bla">
        <FieldHeaderStyle Width="200" />
            <asp:BoundField ItemStyle-Width="200" ControlStyle-Width="150" />

    Open in new window

    LVL 2

    Author Comment

    Great, I will award you the points. But do you know what the difference between ItemStyle-Width and ControlStyle-Width ?
    LVL 39

    Expert Comment

    Yes. The control-style with should be the textbox, if any. The ItemStyle width should be the cell. If you would have an asp:ImageField, the controlstyle would be on the image, and for an asp:CommandField the controlstyle would be on the button itself.

    In other words: the ItemStyle is applied to the TD and the ControlStyle to the element (if any) that is created in the TD.

    -- Abel --
    LVL 2

    Author Closing Comment

    Thank you!

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    746 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

    18 Experts available now in Live!

    Get 1:1 Help Now