Re: CSS and the Data grid control....
From: Kevin Spencer (kevin_at_takempis.com)
Date: 03/26/04
- Next message: Matt Hawley: "Multiple Forms in ASP.Net"
- Previous message: Martin Dechev: "Re: VsualStudio IDE does not search or replace all on multiples, do I have a bad setting?"
- In reply to: Scott: "Re: CSS and the Data grid control...."
- Next in thread: Scott: "Re: CSS and the Data grid control...."
- Reply: Scott: "Re: CSS and the Data grid control...."
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 26 Mar 2004 10:37:21 -0500
See http://www.csszengarden.com
--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Scott" <noemail@this-is-extra-hotmail.com> wrote in message
news:#WhEUU0EEHA.1368@TK2MSFTNGP11.phx.gbl...
>
> Then how do you style normal items vs. alternating items? If you don't
provide styles on the
> control for normal vs. alternating items they both come out as normal
<tr>... I believe the same is
> true of the selected items in the DataGrid. You can do a lot with a single
CSS but if you want the
> kind of styling that the control has built-in you have to "classify" the
tags of the underling
> table.
>
> Though, if you have some way to do this in a single CSS class, I love to
see it.
>
> Scott
>
>
> "Kevin Spencer" <kevin@takempis.com> wrote in message
news:utHUVA0EEHA.3784@TK2MSFTNGP10.phx.gbl...
> > > You can't really change the display of the DataGrid without some
> > programming (especially if you've
> > > done any styling of the control) and achieve the same results using
CSS
> > tags vs. styling it
> > > yourself.
> >
> > I'm afraid I have to take issue with this statement. It is certainly
> > possible to assign a single CSS Class to a Data Grid, and define
completely
> > the styles that each HTML element in the DataGrid should have.
> >
> > --
> > HTH,
> > Kevin Spencer
> > .Net Developer
> > Microsoft MVP
> > Big things are made up
> > of lots of little things.
> >
> > "Scott" <noemail@this-is-extra-hotmail.com> wrote in message
> > news:usoZb7zEEHA.3256@TK2MSFTNGP09.phx.gbl...
> > >
> > > You can't really change the display of the DataGrid without some
> > programming (especially if you've
> > > done any styling of the control) and achieve the same results using
CSS
> > tags vs. styling it
> > > yourself.
> > >
> > > What we do is to create our own derived class from DataGrid and
override
> > the the OnItemCreated
> > > method to attach a css classes to the various bits of the DataGrid (if
you
> > really want to do a
> > > strict job of this, then you have to "remove" any programmer styling).
> > It's not perfect but it works
> > > most of the time.
> > >
> > > In OnItemCreated, assuming that you've already assigned a css class
to
> > the DataGrid using the
> > > CssClass property; we do something like the following:
> > >
> > > OnItemCreated(object sender, DataGridEventArgs e)
> > > ListItemType t = e.Item.ItemType;
> > > DataGridItem r = e.Item.Controls[0].Parent as DataGridItem;
> > >
> > > if (t == ListItem.Item)
> > > r.CssClass = this.CssClass + "Itm";
> > > else if (t == ListItem.AlternatingItm)
> > > r.CssClass = this.CssClass + "AltItm";
> > > // do the same for the rest of the types
> > >
> > >
> > > In your Css file you could have something like
> > >
> > > .DataGrid {
> > > }
> > >
> > > .DataGridItm {
> > > }
> > >
> > > .DataGridAltItm {
> > > }
> > >
> > > "Ram" <RamKulkari@hotmail.com> wrote in message
> > news:eG%23caGwEEHA.1032@TK2MSFTNGP09.phx.gbl...
> > > > Is it possible to control the appearence of data grid control using
> > external
> > > > style sheets ?
> > > > If so, what should be the syntax ?
> > > > Thanks,
> > > > Ram
> > > >
> > > >
> > >
> > >
> >
> >
>
>
- Next message: Matt Hawley: "Multiple Forms in ASP.Net"
- Previous message: Martin Dechev: "Re: VsualStudio IDE does not search or replace all on multiples, do I have a bad setting?"
- In reply to: Scott: "Re: CSS and the Data grid control...."
- Next in thread: Scott: "Re: CSS and the Data grid control...."
- Reply: Scott: "Re: CSS and the Data grid control...."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|