473,680 Members | 3,582 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GridView Column Width


The GridView show an image that takes say 75px in height then I set the next
column to 200px wide because I don't want the text to wrap

However it still wraps the text and the width of the columns remain far less
than 200px

Is there any way to force the width of a column

Below is the code:
<asp:BoundFie ld DataField="Desc ription" SortExpression= "Descriptio n"
ItemStyle-Width="220px"/>

Thank you,

Samuel
Oct 31 '06 #1
2 10499
If you don't want the text to wrap, apply css rule white-space:nowrap. I
think there is also Wrap property in ItemStyle class that you can use.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Samuel Shulman" <sa************ @ntlworld.comwr ote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
>
The GridView show an image that takes say 75px in height then I set the
next column to 200px wide because I don't want the text to wrap

However it still wraps the text and the width of the columns remain far
less than 200px

Is there any way to force the width of a column

Below is the code:
<asp:BoundFie ld DataField="Desc ription" SortExpression= "Descriptio n"
ItemStyle-Width="220px"/>

Thank you,

Samuel


Nov 1 '06 #2
Thank you

I want to set a minimum width I may however have to wrap the text in case it
required more space

Samuel

"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:ed******** ******@TK2MSFTN GP04.phx.gbl...
If you don't want the text to wrap, apply css rule white-space:nowrap. I
think there is also Wrap property in ItemStyle class that you can use.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Samuel Shulman" <sa************ @ntlworld.comwr ote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
>>
The GridView show an image that takes say 75px in height then I set the
next column to 200px wide because I don't want the text to wrap

However it still wraps the text and the width of the columns remain far
less than 200px

Is there any way to force the width of a column

Below is the code:
<asp:BoundFiel d DataField="Desc ription" SortExpression= "Descriptio n"
ItemStyle-Width="220px"/>

Thank you,

Samuel



Nov 1 '06 #3

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

Similar topics

0
2206
by: hammad.awan_nospam | last post by:
Hello, I am using ASP.NET 2.0. What I have done is nested a gridview inside another column of a gridview using a template data field column declaritively in my web form. Inside this child gridview I have set an ItemStyle property of width 20% for the first templated field which contains a hyperlink control, and an ItemStyle of width 80% for the second templated field which contains a label. Both of these controls are databound to...
1
9350
by: Miguel Dias Moura | last post by:
Hello, I have a GridView in my page which is created in runtime. It works fine. My page has 2 Asp Buttons: - The HIDE button makes GridView.Visible = False; - The SHOW button makes GridView.Visible = True. I press HIDE and the GridView disappears as expected. After it I press SHOW and the GridView doesn't show.
5
10281
by: Steve Bugden | last post by:
Hi, I would like to set the column widths in the ASP.NET GridView control at runtime I have tried the following: http://msdn2.microsoft.com/en-us/library/ms178296.aspx Which uses the following code on a button: Protected Sub Button1_Click(ByVal sender As Object, _
4
15389
by: Chuck | last post by:
I'm setting the column with for a gridview (25+- columns) and have paging turned on. When the gridview is first displayed, the column widths are all set to the default. But after paging to another page, the widths are set as they should be. Going back to page one, the widths are still correct. Not a clue what's going on here!
0
2422
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...
1
6725
by: Jeff | last post by:
ASP.NET 2.0 I've got problems with the right column in my GridView. The GridView consist of 2 columns, the problem column is the column on the right side. The problem is that it looks like there is a huge space between the 2 columns, see the huge grey space between the 2 columns. I want the columns to be very close to each other with only 10px open space between the columns. Now it looks like there is a 160px margin between them
1
15040
by: savajx1 | last post by:
I need to dynamically create a set of bound fields contained in a GridView control. I also have a single static CommandField that I can declare in the Columns <tagof the GridView control. I have to add controls dynamically as I am trying to write a reusable , general , spreadsheet like display control that can take advantage of the built- in update and delete features of the SqlDataSource/Gridview controls. This user control can get its...
3
17525
by: =?Utf-8?B?SmVu?= | last post by:
I would like to set the width on 2 columns of a asp.net gridview control, but I'm having trouble making this work. Here is the code I use to create the gridview: 'Create a new data table m_dsTable = New Data.DataTable m_dsTable.Columns.Add("Name", System.Type.GetType("System.String"), "") m_dsTable.Columns.Add("URL", System.Type.GetType("System.String"), "") 'Add two new command fields to select and delete
4
25525
by: Yin99 | last post by:
I have a Gridview binding to a DataTable source. I'd like to set the column with of the second column. I cannot do this apparently because when AutoGenerateColumns=true, they do not appear in the columns collection. I modified the RowCreated even to gridview, and I can change properties on the cells, but not width. (setting tooltip, background color, etc, all work but changing width has no effect). Here's sample code I am using:
1
1844
nitindel
by: nitindel | last post by:
Hi All, Please tell me any good site for Gridview control.(not for datagrid). I am facing error in fetching the values of the Bound columns in the gridview: lease tell me how should i fetch the value..of a bound column..?? Below is the code.:
0
9030
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8912
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...
0
8763
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6424
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
5783
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
4296
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...
1
2925
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
2183
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.