473,406 Members | 2,698 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,406 software developers and data experts.

Setting the width of a datagridColumn

I am building my DataGrid dynamically and am trying to set the width but am
having a problem with it.

If I do:

DataGrid1.Columns(0).Width = New Unit("65px")

I get the error:

'Width' is not a member of 'System.Web.UI.WebControls.DataGridColumn'.

Or

Dim column as BoundColumn = new BoundColumn()
column.Width = new Unit("100px")

I get the error:

'Width' is not a member of 'System.Web.UI.WebControls.BoundColumn'.

Or

column.ItemStyle-Width = new Unit(100px)

I get the error:

Method arguments must be enclosed in parentheses

How can I set the width of the column? I don't want the system to decide
which size to make the columns.

Thanks,

Tom
Aug 29 '07 #1
0 892

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

Similar topics

5
by: Prateek | last post by:
Hi, How can I change the width of a column in datagrid control? TIA Prateek
2
by: Andrew | last post by:
I am trying to set the column information - which ones I want displayed and how with the web grid control. The interface has some big differences when compared to the winform. Is this possible...
1
by: Manny Chohan | last post by:
Hi guys, i have the following code in Datagrid: <asp:TemplateColumn HeaderText="Delete" headerImageUrl=../../Images/i.p.delete.gif"> <ItemTemplate> <asp:CheckBox ID=Chk1 Enabled="True"...
4
by: Adam Boczek | last post by:
I've a dropdownlist control to change language on my page. Because of page lifetime, I have to set all my labels, texts etc. from ResourceManager in prerender handler to be sure that culture change...
7
by: Girish | last post by:
OK.. phew. Playing with data grids for the past few days has been fun and a huge learning experience.. My problem. I have a requirement to display a gird with a gird. Within the embedded grid,...
1
by: Mad Scientist Jr | last post by:
I am having a hard time figuring out how to set header text for a datagrid - I have found a number of pages on it but none work. Some seem to be for vb.net desktop applications not web. Can...
2
by: Lekker Ding | last post by:
Hi All Does anyone know how to code a dropdownlistcolumnstyle in a datagridcolumn in vb.net? Thanks! Ch LD
2
by: tshad | last post by:
I am getting this error trying to dynamically added a column to my DataGrid. I have the following code: Function CreateBoundColumn(c as DataColumn) as DataGridColumn Dim column as...
8
by: Andrus | last post by:
..NET 2 Winforms application. How to create new setting and set it default value in userSettings section of app.config file or overwrite existing setting value ? I found code below in this list...
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?
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
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.