Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am binding few records to Grid view and few of the rows of all cells, we are making background color to Blue. When i click on one of link button available in current page (Window1), it will redirect to new page in new window (Window2). i.e It will open new page in new window. The issue is

After opening of new window(Window2), if i come to first window (Window1) (grid view and link button is available), the grid view row cells background color is loosing. But it should be view as per the above i.e those row cells background color should be BLUE. But it is loosing the color.

I request please help me out from this issue.

Thanks
Raj..
Posted
Comments
Al Moje 17-Nov-11 22:37pm    
Please post your code...
hitech_s 18-Nov-11 1:10am    
where did you assign back color
Sunasara Imdadhusen 21-Nov-11 0:48am    
Please provide snippet of code!

1 solution

try this code

C#
void maintainColor()
       {
           CheckBox chk;

           foreach (GridViewRow gridviewrow in grvAuction.Rows)
           {
               chk = (CheckBox)gridviewrow.Cells[1].FindControl("chkitem");
               if (chk.Checked == true)
               {
                   gridviewrow.Attributes.CssStyle.Add("background-color", "#79B7E7");
                   gridviewrow.Attributes.CssStyle.Add("color", "white");
               }
               else
               {
                   if (gridviewrow.RowState == DataControlRowState.Alternate)
                   {
                       gridviewrow.Attributes.CssStyle.Add("background-color", "white");
                       gridviewrow.Attributes.CssStyle.Add("color", "#284775");

                   }
                   else
                   {
                       gridviewrow.Attributes.CssStyle.Add("background-color", "#F7F6F3");
                       gridviewrow.Attributes.CssStyle.Add("color", "'#333333");

                   }

               }
           }

       }


call this method after you redirect the page..

hope it helps..




mark this as answer if it helps you.. thanks..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900