Showing posts with label backcolor. Show all posts
Showing posts with label backcolor. Show all posts

Wednesday, March 28, 2012

Tablecell backcolor?

// Add the new cell that will host the child grid

TableCell newCell = new TableCell();

newCell.ColumnSpan = cellsToSpanOver;

newCell.BackColor ="#fafad2"; ************ I know this is not right

--
DavidTry to use css classes... It should be better...

--

Thanks,
Yunus Emre ALPZEN
BSc, MCSD.NET

"Fetty" <davef@.helixpoint.com> wrote in message
news:%23DVhA1uYFHA.1404@.TK2MSFTNGP09.phx.gbl...
> // Add the new cell that will host the child grid
> TableCell newCell = new TableCell();
> newCell.ColumnSpan = cellsToSpanOver;
> newCell.BackColor ="#fafad2"; ************ I know this is not right
>
> --
> David
if you look at the datatype of BackColor, you'll see its of datatype Color,
so you know you need to pass a Color. Now we look in the doc's for the Color
class. Here we see a bunch of ways to create a color, from name, from RGB,
etc. so after 60 seconds of reading the doc's we get:

newCell.BackColor = Color.FromArgb(0xfafad2);

-- bruce (sqlwork.com)

"Fetty" <davef@.helixpoint.com> wrote in message
news:%23DVhA1uYFHA.1404@.TK2MSFTNGP09.phx.gbl...
> // Add the new cell that will host the child grid
> TableCell newCell = new TableCell();
> newCell.ColumnSpan = cellsToSpanOver;
> newCell.BackColor ="#fafad2"; ************ I know this is not right
>
> --
> David

Tablecell backcolor?

// Add the new cell that will host the child grid
TableCell newCell = new TableCell();
newCell.ColumnSpan = cellsToSpanOver;
newCell.BackColor ="#fafad2"; ************ I know this is not right
DavidTry to use css classes... It should be better...
Thanks,
Yunus Emre ALPZEN
BSc, MCSD.NET
"Fetty" <davef@.helixpoint.com> wrote in message
news:%23DVhA1uYFHA.1404@.TK2MSFTNGP09.phx.gbl...
> // Add the new cell that will host the child grid
> TableCell newCell = new TableCell();
> newCell.ColumnSpan = cellsToSpanOver;
> newCell.BackColor ="#fafad2"; ************ I know this is not right
>
> --
> David
>
if you look at the datatype of BackColor, you'll see its of datatype Color,
so you know you need to pass a Color. Now we look in the doc's for the Color
class. Here we see a bunch of ways to create a color, from name, from RGB,
etc. so after 60 seconds of reading the doc's we get:
newCell.BackColor = Color.FromArgb(0xfafad2);
-- bruce (sqlwork.com)
"Fetty" <davef@.helixpoint.com> wrote in message
news:%23DVhA1uYFHA.1404@.TK2MSFTNGP09.phx.gbl...
> // Add the new cell that will host the child grid
> TableCell newCell = new TableCell();
> newCell.ColumnSpan = cellsToSpanOver;
> newCell.BackColor ="#fafad2"; ************ I know this is not right
>
> --
> David
>

TableCell: BackColor Property But No BackGround Property?

I am using an ASP:Table Control to make a table. I know that the HTML TD tag
has a background attribute and a bgcolor attribute. The TableCell has a
BackColor property, which is the equivelant of the HTML bgcolor attribute,
but what can I use as an equivelant for the HTML background attribute?
Thanks.
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/I would have to look but my first thought is this. The control will render
whatever attribute you add. So you can add it declaratively with
attribute="value" syntax or on in the code you can add it through the
Attributes collection on the control.

C#
control.Attributes.Add("Name", "Value");

I think you can do this too, because I think it is a NameValueCollection
which means it handles the add automatically.
control.Attributes["Name"] = "Value";

"Nathan Sokalski" wrote:

> I am using an ASP:Table Control to make a table. I know that the HTML TD tag
> has a background attribute and a bgcolor attribute. The TableCell has a
> BackColor property, which is the equivelant of the HTML bgcolor attribute,
> but what can I use as an equivelant for the HTML background attribute?
> Thanks.
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/
>