webgrid background color problem

3 replies. Last post: July 1, 2012 11:32 PM by Bernard Xiang
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
caMember

hi,


I have a webgrid , where i have changed the background using the below code


<FormatConditions>
<ISWebGrid:WebGridFormatCondition ColumnMember="VIEWED" ConditionText="Y" Name="WebGridFormatCondition0">
<FormatStyle BackColor="white" BackColor2="darkgray">
</FormatStyle>
</ISWebGrid:WebGridFormatCondition>
<ISWebGrid:WebGridFormatCondition ColumnMember="VIEWED" ConditionText="N" Name="WebGridFormatCondition0">
<FormatStyle BackColor="white" BackColor2="lightgreen">
</FormatStyle>
</ISWebGrid:WebGridFormatCondition>

and also using inside webgridinitilizerow method


 if (e.Row.Cells.GetNamedItem("VIEWED").Text == "Y")
{
e.Row.Cells.GetNamedItem("download").Style.BackColor = System.Drawing.Color.White;
e.Row.Cells.GetNamedItem("REPORTNAME").Style.BackColor2 = System.Drawing.Color.DarkGray;
e.Row.Cells.GetNamedItem("REPORTNAME").Style.BackColor = System.Drawing.Color.White;
}
else
{
e.Row.Cells.GetNamedItem("download").Style.BackColor = System.Drawing.Color.White;
e.Row.Cells.GetNamedItem("REPORTNAME").Style.BackColor2 = System.Drawing.Color.LightGreen;
e.Row.Cells.GetNamedItem("REPORTNAME").Style.BackColor = System.Drawing.Color.White;
}


I am getting the grid perfectly, but problem arise when i just clcik on the grid or row in the grid.

The background color vanishes and come to the default white when clcik on the row.


please let me know the solution


thanks and regards

ca



All times are GMT -5. The time now is 2:51 AM.
Previous Next