Changing width of a datagrid column dynamically

V

Veeves

I would like to change the width of a datagrid column at run time.

I have noticed when creating a datagrid, if the header text is shorter
than the data in the column, then the column width set by the framework
is only wide enough to accomodate the data. The data is packed so closly
together
it is hard to read.

I have tried changing this in the dg_itemdatabound event but ran into a
problem. The e.Item.Cells(1).Width property is in units and it seems it
cannot be cast into an interger for manipulating.

So is there a way to change the width of a datagrid column or more
specifically make the column a little wider than the data
 
R

RobG

Veeves said:
I would like to change the width of a datagrid column at run time.
[...]

I have tried changing this in the dg_itemdatabound event...

DataGrid controls and itemdatabound events belong to .NET, I think you
should ask in a .NET news group.
 

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

Staff online

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top