Home All Groups Group Topic Archive Search About
Author
24 Jun 2006 6:45 PM
Donald Hurley
How do you set the width of the columns in a detailview?  The titles have way
too much room, and I want to control that.

Thanks,
Don Hurley

Author
26 Jun 2006 4:25 AM
Walter Wang [MSFT]
Hi Don,

Thank you for your post.

Based on my understanding, your question is about how to set the field name
column's width in DetailsView. Please feel free to post here if I've
misunderstood anything.

You can use the FieldHeaderStyle-Width property of DetailsView to control
the first column's width of generated table. For example:

        <asp:DetailsView ID="DetailsView1" FieldHeaderStyle-Width="300px"
runat="server" AutoGenerateRows="False" DataKeyNames="ProductID"
            DataSourceID="SqlDataSource1" Width="1000px" Height="50px">

This will set the first column's width to 300px, and the other column's
width will be 700px.

Hope this helps. Please feel free to post here if anything is unclear.

Regards,
Walter Wang (waw***@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.