By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,017 Members | 946 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,017 IT Pros & Developers. It's quick & easy.

Changing width of a datagrid column dynamically

P: n/a
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
*** Sent via Developersdex http://www.developersdex.com ***
Apr 17 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Veeves wrote:
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.
--
Rob
Apr 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.