You can apply backcolor to grid row in 

    Protected Sub GridView1_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound

        e.Row.BackColor = Drawing.Color.AliceBlue 

    End Sub
Introduction: 

Here I will explain how to call a JavaScript function at regular intervals of time or run/execute JavaScript function every 10 seconds or execute JavaScript function at specific time in asp.net.



To execute function repeatedly with fixed time delay we have a function with two parameters called setInterval(functionname, timedelay).

In this function we need to call the required function in functionname field and we need to set the required time delay to execute the function in timedelay field. If you want to see it in example you need to write the code like as shown below

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Run JavaScript function at specific intervals of time</title>
<script type="text/javascript">
var count=0;
function changeColor() {

// Call function with 500 milliseconds gap
setInterval(starttimer, 500);
}
function starttimer() {
count += 1;
var oElem = document.getElementById("divtxt");
oElem.style.color = oElem.style.color == "red" ? "blue" : "red";
document.getElementById("lbltxt").innerHTML = "Your Time Starts: "+count;
}
</script>
</head>
<body>
<div id="divtxt">
<label id="lbltxt" style="font:bold 24px verdana" />
</div>
<button onclick="changeColor();">Start Timer</button>
</body>
</html>
private void export_to_word()
    {

        try
        {
            data_grid_print.Visible = true;
            //grd_detail.Visible = true;
            Response.Clear();
            Response.AddHeader("content-disposition", "attachment;filename=FileName.doc");
            Response.Charset = "";
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.ContentType = "application/vnd.word";

            System.IO.StringWriter stringWrite = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);

            data_grid_print.RenderControl(htmlWrite);
            Response.Write(stringWrite.ToString());

            Response.End();
            htmlWrite.Flush();
            //grd_detail.Visible = false;
            data_grid_print.Visible = false;
        }
        catch (Exception ex)
        {
        }
    }
 private void export_to_pdf()
    {
        try
        {

            data_grid_print.Visible = true;
            HtmlForm form = new HtmlForm();
            form.Controls.Add(data_grid_print);
            StringWriter sw = new StringWriter();
            HtmlTextWriter hTextWriter = new HtmlTextWriter(sw);
            form.Controls[0].RenderControl(hTextWriter);
            string html = sw.ToString();
            Document Doc = new Document();
            PdfWriter.GetInstance
            (Doc, new FileStream(Environment.GetFolderPath
            (Environment.SpecialFolder.Desktop)
            + "\\Pin_report_unsoldpin.pdf", FileMode.Create));
            Doc.Open();
            Chunk c = new Chunk
            ("PDF Report For Unsoldpin  \n",
            FontFactory.GetFont("Verdana", 10));
            Paragraph p = new Paragraph();
            p.Alignment = Element.ALIGN_CENTER;
            p.Add(c);
            Chunk chunk1 = new Chunk
            (" \n", FontFactory.GetFont("Verdana", 6));
            Paragraph p1 = new Paragraph();
            p1.Alignment = Element.ALIGN_RIGHT;
            p1.Add(chunk1);

            Doc.Add(p);
            Doc.Add(p1);
            System.Xml.XmlTextReader xmlReader =
            new System.Xml.XmlTextReader(new StringReader(html));
            HtmlParser.Parse(Doc, xmlReader);

            Doc.Close();
            string Path = Environment.GetFolderPath
            (Environment.SpecialFolder.Desktop)
            + "\\Pin_report_unsoldpin.pdf";


            //ShowPdf(Path);
            data_grid_print.Visible = false;

        }
        catch (Exception ex)
        {
        }
        finally
        {
        }

    }
private void export_to_excel()
    {
        try
        {
            //grd_detail.Visible = true;
            data_grid_print.Visible = true;
            Response.Clear();

            Response.AddHeader("content-disposition", "attachment;filename=Customerlist.xls");
            Response.Charset = "";
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.ContentType = "application/vnd.xls";
            System.IO.StringWriter stringWrite = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
            data_grid_print.RenderControl(htmlWrite);
            Response.Write(stringWrite.ToString());
            Response.End();
            data_grid_print.Visible = false;
            //grd_detail.Visible = false;
        }
        catch (Exception ex)
        {
        }
        finally
        {
        }

    }