Columnwidth datagrid webform

G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top