GridView CSS styles

G

Goofy

Hi People,

Just wondered how you guys deal with the complex issue of CSS Styles for
Complex server controls like the GridView.

I know its a breeze to set up the styles for AlternatingRowStyles etc etc,
but when it comes to styles for column widths, this is going to change for
every grid you have in your application.

Just wondering if anyone bothers with CSS for GridView other than setting
the general rowstyles and then opt for in-line style for column widths ?

Cheers
 
M

Mark Rae

but when it comes to styles for column widths

I have to say that I never bother with column widths in GridViews because
the control will resize the columns automatically - it's basically just an
HTML table after all...

The only thing I tend to do is to prevent text wrapping in certain columns,
as required...
 
G

Goofy

I usually use column widths when the volume of data requires that text does
wrap otherwise I cant fit it all on, that and columns which occupy too much
width like date feilds etc
 
M

Mark Rae

columns which occupy too much width like date feilds etc

What do you mean by "too much width" in relation to date fields...? Surely
that's what DataFormatString is for, no...?
 
G

Goofy

Yes it is. but because the table autoresizes, sometimes you end up with more
width on the column than the date need, so once you decide your format you
can set the column width to an appropriate size for the date ( or any other
column ).

I find that setting all the column width gives me a consistant look ( But
with variable row heights ). I dont like autosizing and prefer this approach
as we tend to use a lot of descriptive text in our output which ends up
wrapping.
 
M

Mark Rae

I find that setting all the column width gives me a consistant look ( But
with variable row heights ). I dont like autosizing and prefer this
approach as we tend to use a lot of descriptive text in our output which
ends up wrapping.

Fair enough - horses for courses... :)
 

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,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top