468,765 Members | 1,153 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

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 1315
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Hannes | last post: by
reply views Thread by Hannes | last post: by
2 posts views Thread by Daniel Walzenbach | last post: by
reply views Thread by DC Gringo | last post: by
4 posts views Thread by max | last post: by
reply views Thread by herman404 | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.