/// <summary>
 /// To bind Portfolio manager details in grid
 /// </summary>
 /// <param name="DtPortMana"></param>
 private void BindPortMana(DataTable DtPortMana)
 {
     if (DtPortMana.Rows.Count > 0)
     {
         GrdPortfolioManager.DataSource = DtPortMana;
         GrdPortfolioManager.DataBind();
         for (int i = 0; i < GrdPortfolioManager.Rows.Count; i++)
         {
             Label      lblPLUser = (GrdPortfolioManager.Rows[i].FindControl("lblUser") as Label);
             Label      lblStatus = (GrdPortfolioManager.Rows[i].FindControl("lnkStatus") as Label);
             LinkButton lnkStatus = (GrdPortfolioManager.Rows[i].FindControl("lnkEdit") as LinkButton);
             string     Status    = lblStatus.CssClass.ToString();
             if (Status == "True")
             {
                 lblStatus.Text           = "Active";
                 lnkStatus.Text           = "Deactivate";
                 lnkStatus.Font.Underline = true;
             }
             else
             {
                 lblStatus.Text           = "InActive";
                 lnkStatus.Text           = "Activate";
                 lnkStatus.Font.Underline = true;
             }
         }
     }
     else
     {
         GrdPortfolioManager.DataSource = null;
         GrdPortfolioManager.DataBind();
     }
 }
    DataView DvPortFolio;                   // For Menu Details View

    /// <summary>
    /// Page load Method
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        // To set Selected accordion open
        Accordion MasterAcc = (Accordion)Master.FindControl("acdnMaster");
        int       MenuInd   = MasterAcc.SelectedIndex;
        int       MenuIndex = Convert.ToInt16(Session["SrNo"]);

        MasterAcc.SelectedIndex = MenuIndex - 1;
        // To select loginuser id and login username
        Login objMenu = new Login();

        objMenu.Start();
        UserName  = objMenu.LogedInUser;
        LoginUser = objMenu.LoginUser;
        Ret       = objMenu.Ret;
        if (!Page.IsPostBack)
        {
            IsActive = true;
            // To sort defaulty by Ascending order
            ViewState["Sort"] = "ASC";
            // To fetch Portfolio Manager details having active status
            DataTable DtPortMana = PortManaActiveDetails(IsActive);
            ViewState["DtPortMana"] = DtPortMana;
            if (DtPortMana.Rows.Count > 0)
            {
                BindPortMana(DtPortMana);
            }
            else
            {
                GrdPortfolioManager.DataSource = null;
                GrdPortfolioManager.DataBind();
            }
        }
    }