473,395 Members | 1,595 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

GridView BoundField Width

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?
Feb 12 '08 #1
2 11240
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>

<mo******@gmail.comwrote in message
news:4b**********************************@n20g2000 hsh.googlegroups.com...
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?
Feb 12 '08 #2
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
Label" SortExpression="YourFieldName" >
* * * * * * * * <ControlStyle Width="500px" />
* * * * * * * * <ItemStyle Width="500px" />
* * * * * * </asp:BoundField>

<mohaa...@gmail.comwrote in message

news:4b**********************************@n20g2000 hsh.googlegroups.com...
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?- Hide quoted text -

- Show quoted text -
Feb 12 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Aws | last post by:
My crazy GridView !! I am using Visual Studio 2005, I have a problem with my GridView. I have one access .mdb table and when I update a record on the table EVERYTHING is perfect. I made a Web...
2
by: Michael | last post by:
Hi Everyone, I have a gridview control with the following markup: <asp:GridView ID="grdPOs" runat="server" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966"...
5
by: Michael | last post by:
Hi Everyone, I've been having a problem with the Gridview control. I have posted a few messages relating to the issues, but I have a general question. Does the Dataview control have to be bound to...
0
by: Innova | last post by:
Hi, We are working on a gridview inside the gridview (parent-child) scenario. The data of child grid will depend on the data of parent. Objectives: 1.Add new row in parent grid after each row...
0
by: Luigi | last post by:
Hi all, I have the GridView with this code: <asp:GridView OnDataBound="VisualizzaExcel" EnableViewState="False" ID="GridView1" runat="server" AutoGenerateColumns="False"...
0
by: landesjoe | last post by:
Hi, here's my problem in short: Text boxes in gridview don't seem to hold their value if the column's .Visible property is changed back and forth. I've got a form with a gridview populated from...
4
by: =?Utf-8?B?Y2hyaXM=?= | last post by:
I have a perent gridview which includes in a template field a child gridview. Child gridview includes command buttons for opening different windows based on its row selected. I used the code...
1
by: mark4asp | last post by:
I moved a page to another web-site and now it's broke! I had 5 pages in their own web-site. These pages have now been moved to another web-site. Everything is fine except that one of the pages,...
4
by: =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?= | last post by:
I setup a simple gridview as a utility just to do some updates, nothing fancy just wanted easy UI to make updates. When I select ‘Edit’, I get the fields I want to edit. I edit them and click...
0
by: sharonrao123 | last post by:
hello all, I have a parent gridview company and in this one a nested gridview people, Is it possible to allow the user to select one row or multiple rows from the people gridview using a check box...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.