Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Datagrid Column Width

Reply
Thread Tools

Datagrid Column Width

 
 
Chris
Guest
Posts: n/a
 
      03-21-2005
Is there a way to autosize the Datagrid column widths to just a bit larger
than the data. I know how to manually size the column in code but I have a
dynamically created datagrid and it work except the data is all squeezed
together. I'd like a way to measure the text in the column and then
increase the size a little so it's easier to read.

Thanks
Chris


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      03-21-2005
Chris,

You can simply apply padding-left and padding-right css rules to the cells.
You can access cells in either ItemDataBound or PreRender event.

Eliyahu

"Chris" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is there a way to autosize the Datagrid column widths to just a bit larger
> than the data. I know how to manually size the column in code but I have

a
> dynamically created datagrid and it work except the data is all squeezed
> together. I'd like a way to measure the text in the column and then
> increase the size a little so it's easier to read.
>
> Thanks
> Chris
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
picture width decides table column width David Basford HTML 3 09-30-2007 10:49 PM
fixed-width column and variable-width columns mixed ssk HTML 5 10-30-2006 07:50 AM
setting Column width of Template Column in Datagrid.. Charleees ASP .Net 2 06-20-2006 12:52 PM
Textbox width scaling to width of data not width of page? AndrewF ASP .Net 1 10-10-2005 04:38 PM
DG Column Width vs Table Column Width Carl Howarth ASP .Net Datagrid Control 1 10-24-2004 08:48 AM



Advertisments