T
tshad
I am trying to add a different color to some of the rows in my dropdown list
and this is how it is suggested to do this in a couple of articles.
I have a DropDownList call PayDates and I was going to set any row not in my
DataSet to Red.
PayDates.Items[3].Attributes.Add("style", "color:red");
for(ktr=1;ktr<= PayDates.Items.Count - 1;ktr++)//
{
rows = BatchIDDataSet.Tables[0].Select("BatchID = '" +
PayDates.Items[ktr].Text.Substring(0,PayDates.Items[ktr].Text.IndexOf(" /"))
+ "'");
if (rows.Length > 0)
PayDates.Items[ktr].Attributes.Add("style", "color:red");
}
In this case all the rows, except the 1st one should be Red. The debug
showed the rows.length to be 1 for all these rows. But the color was still
black and the viewsource showed that there was no Style attribute anywhere.
So when this didn't work, I tried to add a specific row and not do the
For/Loop:
PayDates.Items[3].Attributes.Add("style", "color:red");
So that only row one would be red. This didn't work either.
What am I missing? The data is there - just all black.
Thanks,
and this is how it is suggested to do this in a couple of articles.
I have a DropDownList call PayDates and I was going to set any row not in my
DataSet to Red.
PayDates.Items[3].Attributes.Add("style", "color:red");
for(ktr=1;ktr<= PayDates.Items.Count - 1;ktr++)//
{
rows = BatchIDDataSet.Tables[0].Select("BatchID = '" +
PayDates.Items[ktr].Text.Substring(0,PayDates.Items[ktr].Text.IndexOf(" /"))
+ "'");
if (rows.Length > 0)
PayDates.Items[ktr].Attributes.Add("style", "color:red");
}
In this case all the rows, except the 1st one should be Red. The debug
showed the rows.length to be 1 for all these rows. But the color was still
black and the viewsource showed that there was no Style attribute anywhere.
So when this didn't work, I tried to add a specific row and not do the
For/Loop:
PayDates.Items[3].Attributes.Add("style", "color:red");
So that only row one would be red. This didn't work either.
What am I missing? The data is there - just all black.
Thanks,