Gridview / Table - Cell Backcolor Blinking feature

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nirmala26
    New Member
    • Nov 2008
    • 7

    Gridview / Table - Cell Backcolor Blinking feature

    Hi All,

    I am using C#.net to develop a web application. I have a gridview and a table displaying two different lists of data. I want to have the backcolor of the cell (of both gridview and table) to blink between two colors, say for example the cell background color must blink (two colors using yellow, green).

    Is this possible ? I am able to only set the backcolor property with just one value.

    Can anyone help me with some ideas on how to get this working ?

    Thanks.
    Last edited by Frinavale; Jan 9 '09, 02:48 PM. Reason: Moved to ASP.NET from .NET
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    This is possible if you implement JavaScript that will run in the web browser (client side) that changes the background colour of the cells.

    -Frinny

    Comment

    • nirmala26
      New Member
      • Nov 2008
      • 7

      #3
      Can you give me an example to shw how it can be done ? Let me explain to u what i am trying to achieve - for each cell, there could be a specific color background - either single color or combination of 2 colors. If its just one color, i want it to be constant (no blinking) and i am able to do this by setting the BackColor property of the cell (both table & gridview) to the specific color value and it works fine..But when its 2 colors, then i want the colors to flash one after other continously till the page is closed. And I tried using Javascript (to start with using an interval but it doesnt seem to work...can u please guide me on how i could get this done. The javascript i used is as follows -

      Code:
      function blinkit()
          {
          intrvl=0;
          for(nTimes=0;nTimes<60;nTimes++)
          {
          intrvl += 10;
          
          setTimeout("document.BackColor='#0000FF';",intrvl);
          intrvl += 10;
          setTimeout("document.BackColor='#FFFFFF';",intrvl);
          }
      Thanks a lot in advance.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        In your RowDataBound event check which cells need to have the blinking effect applied to them and record their ids into a JavaScript array. You can then loop through the array of cells ind your JavaScript that controls the blinking.

        To create a JavaScript array you will need to register it using the ClientScriptMan ager.RegisterAr rayDeclaration method.

        Cheer!

        -Frinny

        Comment

        Working...