Column Width of DetailsView

D

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
 
W

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 ([email protected], 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top