473,385 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

CSS Classes can cause problems

I just found an interesting anomaly that I had not seen before.

It seems to affect both Datalist and Datagrids. If you set the background
color of the DataGrids using CSSClass (which is valid) instead of using
backcolor, you cannot programmatically set the color of the datalistitem or
datagriditem.

I was doing this to indicate which row the user wanted to move. I would set
the color as green. But I found that every other color would not show the
green color. After some checking I found that I had set the alternating
color as linen like so:

<alternatingitemstyle CssClass=alternateRow
</alternatingitemstyle>
if I set it as:

<alternatingitemstyle backcolor="linen"</alternatingitemstyle>


I have no problem.

I am not sure why it works ok with backcolor, but I assume that when I
programmatically set the color like so:

Dim oDLI as DataListItem = s.parent.parent
oDLI.BackColor = System.Drawing.Color.Green

when the page is returned the CSS Class is applied over the color I had set.

Interesting, but not fun.

Tom
Nov 19 '05 #1
2 1019
"tshad" <ts**********@ftsolutions.com> wrote in message
news:eL**************@TK2MSFTNGP15.phx.gbl...
I just found an interesting anomaly that I had not seen before.

It seems to affect both Datalist and Datagrids. If you set the background
color of the DataGrids using CSSClass (which is valid) instead of using
backcolor, you cannot programmatically set the color of the datalistitem
or datagriditem.

I was doing this to indicate which row the user wanted to move. I would
set the color as green. But I found that every other color would not show
the green color. After some checking I found that I had set the
alternating color as linen like so:

<alternatingitemstyle CssClass=alternateRow
</alternatingitemstyle>
if I set it as:

<alternatingitemstyle backcolor="linen"
</alternatingitemstyle>


I have no problem.

I am not sure why it works ok with backcolor, but I assume that when I
programmatically set the color like so:

Dim oDLI as DataListItem = s.parent.parent
oDLI.BackColor = System.Drawing.Color.Green

when the page is returned the CSS Class is applied over the color I had
set.

Interesting, but not fun.


I just found that it only has a problem in Mozilla and not in IE.

In mozilla, the code from viewsource shows:

<tr class="alternateRow" bgcolor="Green">

In IE it shows as:

<td class="alternateRow" style="background-color:Green;">

Bot have the class set, but for some reason Mozilla chooses the class, and
IE chooses the style. It is also interesting that Mozilla converts my
"oDGI.BackColor = System.Drawing.Color.Green" to bgcolor and IE converts it
to a style.

Tom
Tom

Nov 19 '05 #2
Thanks for the info..
Patrick
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: vrillusions | last post by:
I've been using functions since I first started using php, but I've been hearing more and more about classes, which I never really looked at that much. I understand the whole OO programming...
5
by: thelobster | last post by:
Hey, I've been programming PHP for about 2 years and have dabbled with classes. I'm working on a project and can't seam to figure out how to use classes within classes. For example: ...
145
by: David MacQuigg | last post by:
Playing with Prothon today, I am fascinated by the idea of eliminating classes in Python. I'm trying to figure out what fundamental benefit there is to having classes. Is all this complexity...
2
by: Hugh McLaughlin | last post by:
Hello Everyone and thanks for your help in advance. I have read a great deal about code reuse and the development of the three-tier application, but am somewhat confused on some issues and am...
45
by: Steven T. Hatton | last post by:
This is a purely *hypothetical* question. That means, it's /pretend/, CP. ;-) If you were forced at gunpoint to put all your code in classes, rather than in namespace scope (obviously classes...
9
by: Gomaw Beoyr | last post by:
Two question about the "partial classes" (in the next wersion of ..NET). Question 1 ========== Will partial classes (in the next version of C#) have to be declared "partial" in ALL places. ...
2
by: BoloBaby | last post by:
Earlier, I had a threading issue where I had to use the InvokeRequired to get my controls to function properly. Does InvokeRequired apply to my custom classes as well? That is, if I have...
3
by: jason | last post by:
Please pardon my completely lack of understanding on the topic. I have a website I developed with another developer. We are both far from experts in VB.NET and OOP. We developed the site WITHOUT...
4
by: mailcsprasad | last post by:
When to use STL classes and when to use MFC Container classes?
2
weaknessforcats
by: weaknessforcats | last post by:
Handle Classes Handle classes, also called Envelope or Cheshire Cat classes, are part of the Bridge design pattern. The objective of the Bridge pattern is to separate the abstraction from the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.