protected void gridFabStatus_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;

            for (int i = 0; i < item.Cells.Count; i++)
            {
                item.Cells[i].Text = item.Cells[i].Text.ToString(CultureInfo.InvariantCulture.NumberFormat);
            }

            double total_scope  = Convert.ToDouble(item.Cells[2].Text);
            double sg_done      = Convert.ToDouble(item.Cells[3].Text);
            double mat_avl      = Convert.ToDouble(item.Cells[4].Text);
            double jc_issued    = Convert.ToDouble(item.Cells[5].Text);
            double weld_done    = Convert.ToDouble(item.Cells[6].Text);
            double nde_done     = Convert.ToDouble(item.Cells[7].Text);
            double spl_paint    = Convert.ToDouble(item.Cells[8].Text);
            double sent_to_site = Convert.ToDouble(item.Cells[9].Text);

            var sg_dt = new DataTable();

            sg_dt.Columns.Add("SCOPE_TEXT");
            sg_dt.Columns.Add("SCOPE_VALUE");
            sg_dt.Columns.Add("COLOR_CODE");
            sg_dt.Rows.Add("SPOOLGEN PROGRESS", Math.Round(sg_done * 100 / total_scope, 1), "#4DCA5E");
            sg_dt.Rows.Add("BALANCE", Math.Round(100 - Math.Round(sg_done * 100 / total_scope, 1), 1), "#D6D6D6");
            RadHtmlChart2.DataSource = sg_dt;
            RadHtmlChart2.DataBind();

            sg_dt = new DataTable();

            sg_dt.Columns.Add("SCOPE_TEXT");
            sg_dt.Columns.Add("SCOPE_VALUE");
            sg_dt.Columns.Add("COLOR_CODE");
            sg_dt.Rows.Add("SPOOLGEN PROGRESS", Math.Round(mat_avl * 100 / total_scope, 1), "#4DCA5E");
            sg_dt.Rows.Add("BALANCE", Math.Round(100 - Math.Round(mat_avl * 100 / total_scope, 1), 1), "#D6D6D6");
            RadHtmlChart3.DataSource = sg_dt;
            RadHtmlChart3.DataBind();

            sg_dt = new DataTable();

            sg_dt.Columns.Add("SCOPE_TEXT");
            sg_dt.Columns.Add("SCOPE_VALUE");
            sg_dt.Columns.Add("COLOR_CODE");
            sg_dt.Rows.Add("SPOOLGEN PROGRESS", Math.Round(jc_issued * 100 / total_scope, 1), "#4DCA5E");
            sg_dt.Rows.Add("BALANCE", Math.Round(100 - Math.Round(jc_issued * 100 / total_scope, 1), 1), "#D6D6D6");
            RadHtmlChart4.DataSource = sg_dt;
            RadHtmlChart4.DataBind();


            sg_dt = new DataTable();

            sg_dt.Columns.Add("SCOPE_TEXT");
            sg_dt.Columns.Add("SCOPE_VALUE");
            sg_dt.Columns.Add("COLOR_CODE");
            sg_dt.Rows.Add("SPOOLGEN PROGRESS", Math.Round(weld_done * 100 / total_scope, 1), "#4DCA5E");
            sg_dt.Rows.Add("BALANCE", Math.Round(100 - Math.Round(weld_done * 100 / total_scope, 1), 1), "#D6D6D6");
            RadHtmlChart5.DataSource = sg_dt;
            RadHtmlChart5.DataBind();

            sg_dt = new DataTable();

            sg_dt.Columns.Add("SCOPE_TEXT");
            sg_dt.Columns.Add("SCOPE_VALUE");
            sg_dt.Columns.Add("COLOR_CODE");
            sg_dt.Rows.Add("SPOOLGEN PROGRESS", Math.Round(nde_done * 100 / total_scope, 1), "#4DCA5E");
            sg_dt.Rows.Add("BALANCE", Math.Round(100 - Math.Round(nde_done * 100 / total_scope, 1), 1), "#D6D6D6");
            RadHtmlChart6.DataSource = sg_dt;
            RadHtmlChart6.DataBind();

            sg_dt = new DataTable();

            sg_dt.Columns.Add("SCOPE_TEXT");
            sg_dt.Columns.Add("SCOPE_VALUE");
            sg_dt.Columns.Add("COLOR_CODE");
            sg_dt.Rows.Add("SPOOLGEN PROGRESS", Math.Round(spl_paint * 100 / total_scope, 1), "#4DCA5E");
            sg_dt.Rows.Add("BALANCE", Math.Round(100 - Math.Round(spl_paint * 100 / total_scope, 1), 1), "#D6D6D6");
            RadHtmlChart7.DataSource = sg_dt;
            RadHtmlChart7.DataBind();

            sg_dt = new DataTable();

            sg_dt.Columns.Add("SCOPE_TEXT");
            sg_dt.Columns.Add("SCOPE_VALUE");
            sg_dt.Columns.Add("COLOR_CODE");
            sg_dt.Rows.Add("SPOOLGEN PROGRESS", Math.Round(sent_to_site * 100 / total_scope, 1), "#4DCA5E");
            sg_dt.Rows.Add("BALANCE", Math.Round(100 - Math.Round(sent_to_site * 100 / total_scope, 1), 1), "#D6D6D6");
            RadHtmlChart8.DataSource = sg_dt;
            RadHtmlChart8.DataBind();
        }
    }
    protected void ddlSubcon_SelectedIndexChanged(object sender, DropDownListEventArgs e)
    {
        lablesc.Text = ddlSubcon.SelectedText;

        if (ddlSubcon.SelectedText == "ICAD")
        {
            SpoolgenGrid.DataSourceID    = null;
            FabProgressGrid.DataSourceID = null;
            SpoolgenGrid.DataSourceID    = "ICADspgnTableDataSrouce";
            FabProgressGrid.DataSourceID = "ICADfabTableDataSource";
        }
        if (ddlSubcon.SelectedText == "EPIC")
        {
            SpoolgenGrid.DataSourceID    = null;
            FabProgressGrid.DataSourceID = null;

            SpoolgenGrid.DataSourceID    = "EPICspgnTableDataSrouce";
            FabProgressGrid.DataSourceID = "EPICfabTableDataSource";
        }

        if (ddlSubcon.SelectedText == "DIVISION-7")
        {
            SpoolgenGrid.DataSourceID    = null;
            FabProgressGrid.DataSourceID = null;

            SpoolgenGrid.DataSourceID    = "D7spgnTableDataSrouce";
            FabProgressGrid.DataSourceID = "D7fabTableDataSource";
        }

        if (ddlSubcon.SelectedText == "PENTA GLOBAL")
        {
            SpoolgenGrid.DataSourceID    = null;
            FabProgressGrid.DataSourceID = null;

            SpoolgenGrid.DataSourceID    = "PentaspgnTableDataSrouce";
            FabProgressGrid.DataSourceID = "PentafabTableDataSource";
        }

        if (ddlSubcon.SelectedText == "STS")
        {
            SpoolgenGrid.DataSourceID    = null;
            FabProgressGrid.DataSourceID = null;

            SpoolgenGrid.DataSourceID    = "STSspgnTableDataSrouce";
            FabProgressGrid.DataSourceID = "STSfabTableDataSource";
        }

        if (ddlSubcon.SelectedText == "DYCC-7")
        {
            SpoolgenGrid.DataSourceID    = null;
            FabProgressGrid.DataSourceID = null;

            SpoolgenGrid.DataSourceID    = "DYCC7spgnTableDataSrouce";
            FabProgressGrid.DataSourceID = "DYCC7fabTableDataSource";
        }

        RadHtmlChart10.DataSourceID  = "SplSGPrgsVsActualDataSource";
        RadHtmlChart100.DataSourceID = "DWGProgressDataSource";
        RadHtmlChart101.DataSourceID = "PIPDeliveryDataSource";
        RadHtmlChart5.DataSourceID   = "FLANGEDeliveryDataSource";
        RadHtmlChart6.DataSourceID   = "FITTINGDeliveryDataSource";
        RadHtmlChart7.DataSourceID   = "AvlWorkFrontDataSource";
        RadHtmlChart8.DataSourceID   = "CurrentWorkDataSource";
        RadHtmlChart9.DataSourceID   = "SplFabPrgsVsActualDataSource";

        RadHtmlChart10.DataBind();
        RadHtmlChart100.DataBind();
        SpoolgenGrid.Rebind();
        RadHtmlChart101.DataBind();
        RadHtmlChart5.DataBind();
        RadHtmlChart6.DataBind();
        RadHtmlChart7.DataBind();
        RadHtmlChart8.DataBind();
        RadHtmlChart9.DataBind();
        FabProgressGrid.Rebind();
    }