T
tshad
I have a DataList where I am trying to set the background color to
particular DataListItems:
Dim oDLI as DataListItem = s.parent.parent
oDLI.BackColor = System.Drawing.Color.Green
This works fine.
The problem is that on any PostBack, the color is gone (empty).
The DataGrid doesn't seem to have this problem. I can set a DataGridItem
and it will stay that way unless I rebind to it.
This is similar to another problem I had setting the visible attribute
(doesn't work) for the DataListItem.
Is there a setting or something that I can set that will tell it to keep the
attribute setting?
The only other way I can figure is to set an invisible label on the
datalistitem that is nothing more than yes/no whether the color should be
there or not and I can reset it during Page_Load.
That's just a little more work than I would have thought I would have to do.
Thanks,
Tom
particular DataListItems:
Dim oDLI as DataListItem = s.parent.parent
oDLI.BackColor = System.Drawing.Color.Green
This works fine.
The problem is that on any PostBack, the color is gone (empty).
The DataGrid doesn't seem to have this problem. I can set a DataGridItem
and it will stay that way unless I rebind to it.
This is similar to another problem I had setting the visible attribute
(doesn't work) for the DataListItem.
Is there a setting or something that I can set that will tell it to keep the
attribute setting?
The only other way I can figure is to set an invisible label on the
datalistitem that is nothing more than yes/no whether the color should be
there or not and I can reset it during Page_Load.
That's just a little more work than I would have thought I would have to do.
Thanks,
Tom