Hi,
Using v2009.3.1208.35, I'm trying to append a custom CSS class to each row of a grid depending on some databound condition. For example: appending either "active", "disabled" or "pending" depending on the "state" enum.
I tried the following code in the ItemDataBound event, but that replaces the CSS class instead of appending it.
The rgRow and rgAltRow classes are lost from the rendered HTML result.
What I really want is this :
How can I achieve this result? It's NOT a custom skin, just a css class that will be added on top of the skin.
The only another similar thread I've found was this one, but the ApplyStylesOnClient properties mentioned is no longer supported it seems so I cannot try it.
Thanks for your help,
dstj.
Using v2009.3.1208.35, I'm trying to append a custom CSS class to each row of a grid depending on some databound condition. For example: appending either "active", "disabled" or "pending" depending on the "state" enum.
I tried the following code in the ItemDataBound event, but that replaces the CSS class instead of appending it.
switch (state) { |
case StateType.Active: |
e.Item.CssClass += " active"; |
break; |
case StateType.Disabled: |
e.Item.CssClass += " disabled"; |
break; |
case StateType.Pending: |
e.Item.CssClass += " pending"; |
break; |
} |
The rgRow and rgAltRow classes are lost from the rendered HTML result.
What I really want is this :
<tr id="..." class="rgRow active"> |
<td>row 1 (active css class)</td> |
</tr> |
<tr id="..." class="rgAltRow active"> |
<td>row 2 (active css class)</td> |
</tr> |
<tr id="..." class="rgRow disabled"> |
<td>row 3 (disabled css class)</td> |
</tr> |
<tr id="..." class="rgAltRow pending"> |
<td>row 4 (pending css class)</td> |
</tr> |
How can I achieve this result? It's NOT a custom skin, just a css class that will be added on top of the skin.
The only another similar thread I've found was this one, but the ApplyStylesOnClient properties mentioned is no longer supported it seems so I cannot try it.
Thanks for your help,
dstj.