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

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

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

  • 2
  • 2
1 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

brgdotnetAuthor Commented:
Great, I will award you the points. But do you know what the difference between ItemStyle-Width and ControlStyle-Width ?
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 --
brgdotnetAuthor Commented:
Thank you!

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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