changing datagrid column width dynamically

G

Guest

How do I change the datagrid column width dynamically when the grid's being
loaded?
VM
 
I

Ignacio Machin

Hi ,

Below you will find the code I'm using in a web app, you do not especify if
you are on a asp.net or a windows app but for your others post I assume
that.

this.locationgrid.Columns[2].Visible = this.locationgrid.Columns[3].Visible
= false;

this.locationgrid.Columns[1].ItemStyle.Width= 460;


There I set as not visible two columns and set the width of the other to the
size of the sum of the three. Later I set it back using a similar code.

Hope this help,
 

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

Top