protected void BindVoyageData()
    {
        DataTable liTable = new DataTable();

        if (listVoyage.Items.Count > 0)
        {
            for (int x = 0; x < listVoyage.Items.Count; x++)
            {
                //string v1 = listVoyage.Items[0].Value.Split(':')[1].Trim();
                //string v2 = listVoyage.Items[listVoyage.Items.Count - 1].Value.Split(':')[0].Trim();
                string val = listVoyage.Items[x].Value.Split(':')[0] + ":" + listVoyage.Items[x].Value.Split(':')[1];
                KPI_ID = Convert.ToInt32(hiddenKPIID.Value);
                DataTable dtq = BLL_TMSA_PI.GetTelDate(val.Trim(), Convert.ToInt32(ddlvessel.SelectedValue)).Tables[0];
                if (dtq.Rows[0][0].ToString() != "")
                {
                    Startdate = Convert.ToDateTime(dtq.Rows[0][0].ToString());
                }
                if (dtq.Rows[dtq.Rows.Count - 1][0].ToString() != "")
                {
                    EndDate = Convert.ToDateTime(dtq.Rows[dtq.Rows.Count - 1][0].ToString());
                }


                DataTable dt = objKPI.GetVoyageGenericData(listVoyage.Items[x].Value.Trim(), Convert.ToInt32(ddlvessel.SelectedValue), KPI_ID, Startdate, EndDate).Tables[0];

                liTable.Merge(dt);
            }
            gvVoyage.Visible = true;
            gvSearch.Visible = false;

            gvVoyage.DataSource = liTable;
            gvVoyage.DataBind();
            if (liTable.Rows.Count != 0)
            {
                double AVG = Convert.ToDouble(liTable.Compute("AVG(Value)", "").ToString());
                hiddenAVG.Value = Math.Round(AVG, 2).ToString();
                gvVoyage.FooterRow.Cells[4].Text            = "Average: " + Math.Round(AVG, 2).ToString();
                gvVoyage.FooterRow.Cells[4].HorizontalAlign = HorizontalAlign.Center;
                gvVoyage.FooterRow.Cells[4].ForeColor       = System.Drawing.Color.Black;
                gvVoyage.FooterRow.Cells[4].BorderColor     = System.Drawing.ColorTranslator.FromHtml("#EFEFEF");
                gvVoyage.FooterRow.Cells[3].BorderColor     = System.Drawing.ColorTranslator.FromHtml("#EFEFEF");
                gvVoyage.FooterRow.Cells[2].BorderColor     = System.Drawing.ColorTranslator.FromHtml("#EFEFEF");
                gvVoyage.FooterRow.Cells[1].BorderColor     = System.Drawing.ColorTranslator.FromHtml("#EFEFEF");
                gvVoyage.FooterRow.Cells[0].BorderColor     = System.Drawing.ColorTranslator.FromHtml("#EFEFEF");
                //   txtGoal.Text = ds.Tables[1].Rows[0]["Goal"].ToString();
                gvVoyage.FooterRow.BackColor = System.Drawing.ColorTranslator.FromHtml("#abcdef");
                hiddengVoyageCount.Value     = "1";
            }
            else
            {
                hiddengVoyageCount.Value = "0";
            }
        }
    }