473,698 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 11256
This works in a DetailsView so I think it should in a GridView:
<asp:BoundFie ld DataField="Your FieldName" HeaderText="You r Field
Label" SortExpression= "YourFieldN ame" >
<ControlStyle Width="500px" />
<ItemStyle Width="500px" />
</asp:BoundField>

<mo******@gmail .comwrote in message
news:4b******** *************** ***********@n20 g2000hsh.google groups.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:BoundFie ld DataField="Comm ents" HeaderText="Com ments"
SortExpression= "Comments" >
<ControlStyle Width="500px" />
<ItemStyle Width="500px" />
</asp:BoundField>

On Feb 12, 11:20*am, "Paul Shapiro" <p...@hideme.br oadwayData.com>
wrote:
This works in a DetailsView so I think it should in a GridView:
* * * * * * <asp:BoundFie ld DataField="Your FieldName" HeaderText="You r Field
Label" SortExpression= "YourFieldN ame" >
* * * * * * * * <ControlStyle Width="500px" />
* * * * * * * * <ItemStyle Width="500px" />
* * * * * * </asp:BoundField>

<mohaa...@gmail .comwrote in message

news:4b******** *************** ***********@n20 g2000hsh.google groups.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
2287
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 Setup Project and installed My Web Application on my Localhost and it works perfectly. When I install My Web Application on our “Production Server” it just doesn’t update the records on Edit mode!!!
2
2790
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" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="ItemId" Height="68px" PageSize="5" Width="642px"> <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" /> <Columns>
5
2244
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 a datasource that also contains the update/delete Sql statements? The resaon I ask is that I've done just about all I can do and can't update the grid. In the RowUpdating event I'm getting no values in the newvalues or oldvalues vars. I do bind a...
0
8563
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 and add child grid into that row because the columns in child grid are same as parent grid and we want to align them with the cols of parent grid. 2. If there is data for child grid we show a plus image in the parent row (in the row above the...
0
1608
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" DataKeyNames="COD_SALDO" DataSourceID="SqlDataSource1" CellPadding="4" ForeColor="#333333" GridLines="None" Width="470px"> <Columns> <asp:BoundField DataField="COD_SALDO"
0
2428
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 a data view (which in turn is loaded from a manually setup DataTable for testing purposes). One of the columns in the grid is a checkbox that's tied to an event handler that'll change the .Visible property of a column with a text box. That text...
4
3482
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 below. The event for RowDataBound is executed, rows get different color, but event for RowCommand is not executed. What could be the problem ? Thanks a lot in advance.
1
2701
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, which I had trouble with in the past (i.e. same problem), is now partly broke. The paging no longer fully works in the gridview. The gvAwarded_RowDataBound code works to load the ddlPager with the correct number of pages.
4
8755
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 ‘Update’, the page returns to its original state (prior to clicking Edit) and no updates occur in the DB. What am I missing? I included the html code below. -- Thank-you, Barbara Alderton <body>
0
4664
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 and also get the datakey (in my case personid) of the the rows selected. Please point me in the right direction. This is what i have so far but i have problem accessing the child gridview in the button click event Cheers, Shilpa. <asp:GridView...
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9031
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8904
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.