Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

GridView BoundField Width

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mohaaron@gmail.com - 12 Feb 2008 19:02 GMT
Why does it seem like is impossible to set the width of a BoundField
in a GridView. I've tried all sorts of different way to set the width
and none of them work. So far the only thing I've done that has worked
is to set the Wrap property to false which is not what I want do.

Can anyone tell me now to set the column width of a GridView in the
aspx file code?
Paul Shapiro - 12 Feb 2008 19:20 GMT
This works in a DetailsView so I think it should in a GridView:
           <asp:BoundField DataField="YourFieldName" HeaderText="Your Field
Label" SortExpression="YourFieldName" >
               <ControlStyle Width="500px" />
               <ItemStyle Width="500px" />
           </asp:BoundField>

> Why does it seem like is impossible to set the width of a BoundField
> in a GridView. I've tried all sorts of different way to set the width
[quoted text clipped - 3 lines]
> Can anyone tell me now to set the column width of a GridView in the
> aspx file code?
mohaaron@gmail.com - 12 Feb 2008 19:43 GMT
I just tried the following and it doesn't work.

<asp:BoundField DataField="Comments" HeaderText="Comments"
SortExpression="Comments" >
    <ControlStyle Width="500px" />
    <ItemStyle Width="500px" />
</asp:BoundField>

On Feb 12, 11:20 am, "Paul Shapiro" <p...@hideme.broadwayData.com>
wrote:
> This works in a DetailsView so I think it should in a GridView:
>             <asp:BoundField DataField="YourFieldName" HeaderText="Your Field
[quoted text clipped - 16 lines]
>
> - Show quoted text -

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.