473,394 Members | 1,722 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,394 software developers and data experts.

Columnwidth datagrid webform

Hi,

I'm using a datagrid on a webform with 4 visible and 1 invisible columns.
When clicking a button I want to make the invisible column visible. I use the
code

DataGrid1.Columns(4).Visible = True

All fine, but the problem is that the columnwidth changes of all the
columns. I would be nice if columns 1 ... 3 have the same width. So column
width 4 + 5 = constant.

The datagrid has a width 980 px

In the Property builder I set the column width properties to
Column 0 20 %
Column 1 20 %
Column 2 20 %
Column 3 20 %
Column 4 20 %

Working with a datagrid on a Windowsform you can use tablestyles, but how
does it work on a webform?

Many thanks,

Willem

Nov 19 '05 #1
1 1428
Willem, I presume you're trying to "fix" the width at 980? How about this:
Set 0, 1, and 2 to width=196px, and set 3 to either 196 or 392, depending on
whether 4 is visible? This should work unless the data in the last column can
wrap.

Bill

"Willem" wrote:
Hi,

I'm using a datagrid on a webform with 4 visible and 1 invisible columns.
When clicking a button I want to make the invisible column visible. I use the
code

DataGrid1.Columns(4).Visible = True

All fine, but the problem is that the columnwidth changes of all the
columns. I would be nice if columns 1 ... 3 have the same width. So column
width 4 + 5 = constant.

The datagrid has a width 980 px

In the Property builder I set the column width properties to
Column 0 20 %
Column 1 20 %
Column 2 20 %
Column 3 20 %
Column 4 20 %

Working with a datagrid on a Windowsform you can use tablestyles, but how
does it work on a webform?

Many thanks,

Willem

Nov 19 '05 #2

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

Similar topics

1
by: Jakob Persson | last post by:
Hi Is there a way to program a DataGrid control to automatically adjust its columnwidth so it fits the contents of the columns. I am searching for a automated way to do the thing you do when...
4
by: Angel | last post by:
How can I update the datatable with the datagrid values after the datagrid itself has been modified.? I assume it's not automatically done. Thanks.
0
by: Hannes | last post by:
Hello! When doubleclicking on the columnseparator of a datagrid the columnwidth ist set to the optimal size for the instantaneous content. Is there a possibility to activate this function...
0
by: Hannes | last post by:
Hello! When doubleclicking on the columnseparator of a datagrid the columnwidth ist set to the optimal size for the instantaneous content. Is there a possibility to activate this function...
2
by: Daniel Walzenbach | last post by:
Hi, I created an ASP.NET Datagrid where a single row can be selected by clicking anywhere on the row (according to...
4
by: Rod | last post by:
I posted a message to this group yesterday asking how to pass parameters to a web form that is the source of an IFrame on a parent web form. I've gotten my answer, and it works. Thanks! Now I...
0
by: DC Gringo | last post by:
I am trying to output simply DataGrid of a coutry listing on a web form via a business object and XML web service...I receive no errors but no table HTML either. (I know the service and business...
4
by: max | last post by:
I am not being a smartass and would honestly like an explanation, if you could take the time. What's wrong with: DataGrid.Column(0).Width = 30? or DataGrid.Column(2).Width = DataGrid.Width -...
0
by: herman404 | last post by:
Hi everyone, I'm trying to dynamically add 3 button columns to a DataGrid object that I have on an ASP.net webpage, but I don't see any documentation on how to do it. I've seen plenty of examples...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
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.