/// <summary>
        ///
        /// </summary>
        /// <param name="currentPage"></param>
        /// <param name="convertedFromDate"></param>
        /// <param name="convertedToDate"></param>
        /// <param name="exportStaus">0 -No Export, 1- Export Current Page , 2 - Export All Pages </param>
        private void BindGrid(int currentPage, DateTime convertedFromDate, DateTime convertedToDate, int exportFlag)
        {
            Dictionary <string, string> genDictTranType = new Dictionary <string, string>();
            DataSet ds    = new DataSet();
            int     Count = 0;

            userType = Session["UserType"].ToString().ToLower();

            string extraSearch = "";

            try
            {
                if (userType == "rm")
                {
                    if (rbtnGroup.Checked)
                    {
                        //rmVo.RMId = 1037;
                        ds = customerTransactionBo.GetRMCustomerEqTransactions(out Count, currentPage, rmVo.RMId, int.Parse(txtParentCustomerId.Value), convertedFromDate, convertedToDate, int.Parse(ddlPortfolioGroup.SelectedItem.Value.ToString()), hdnCustomerNameSearch.Value.Trim(), hdnSchemeSearch.Value.Trim(), hdnTranType.Value.Trim(), out genDictTranType, extraSearch, exportFlag);
                        hdnRecordCount.Value = lblTotalRows.Text = Count.ToString();
                    }
                    else
                    {
                        //rmVo.RMId = 1037;
                        ds = customerTransactionBo.GetRMCustomerEqTransactions(out Count, currentPage, rmVo.RMId, 0, convertedFromDate, convertedToDate, int.Parse(ddlPortfolioGroup.SelectedItem.Value.ToString()), hdnCustomerNameSearch.Value.Trim(), hdnSchemeSearch.Value.Trim(), hdnTranType.Value.Trim(), out genDictTranType, extraSearch, exportFlag);
                        hdnRecordCount.Value = lblTotalRows.Text = Count.ToString();
                    }
                }
                else
                {
                    if (rbtnGroup.Checked)
                    {
                        //rmVo.RMId = 1037;
                        ds = customerTransactionBo.GetAdviserCustomerEqTransactions(out Count, currentPage, advisorVo.advisorId, int.Parse(txtParentCustomerId.Value), convertedFromDate, convertedToDate, int.Parse(ddlPortfolioGroup.SelectedItem.Value.ToString()), hdnCustomerNameSearch.Value.Trim(), hdnSchemeSearch.Value.Trim(), hdnTranType.Value.Trim(), out genDictTranType, extraSearch, exportFlag);
                        hdnRecordCount.Value = lblTotalRows.Text = Count.ToString();
                    }
                    else
                    {
                        //rmVo.RMId = 1037;
                        ds = customerTransactionBo.GetAdviserCustomerEqTransactions(out Count, currentPage, advisorVo.advisorId, 0, convertedFromDate, convertedToDate, int.Parse(ddlPortfolioGroup.SelectedItem.Value.ToString()), hdnCustomerNameSearch.Value.Trim(), hdnSchemeSearch.Value.Trim(), hdnTranType.Value.Trim(), out genDictTranType, extraSearch, exportFlag);
                        hdnRecordCount.Value = lblTotalRows.Text = Count.ToString();
                    }
                }
                DataTable dtTransactions = new DataTable();
                dtTransactions = ds.Tables[0];
                if (dtTransactions.Rows.Count > 0)
                {
                    trMessage.Visible      = false;
                    lblCurrentPage.Visible = true;
                    trPager.Visible        = true;
                    lblTotalRows.Visible   = true;

                    DataTable dtEQTransactions = new DataTable();

                    dtEQTransactions.Columns.Add("TransactionId");
                    dtEQTransactions.Columns.Add("Customer Name");
                    dtEQTransactions.Columns.Add("Scrip");
                    dtEQTransactions.Columns.Add("TradeAccNumber");
                    dtEQTransactions.Columns.Add("Type");
                    dtEQTransactions.Columns.Add("Date");
                    dtEQTransactions.Columns.Add("Rate");
                    dtEQTransactions.Columns.Add("Quantity");
                    dtEQTransactions.Columns.Add("Brokerage");
                    dtEQTransactions.Columns.Add("OtherCharges");
                    dtEQTransactions.Columns.Add("STT");
                    dtEQTransactions.Columns.Add("Gross Price");
                    dtEQTransactions.Columns.Add("Speculative Or Delivery");
                    dtEQTransactions.Columns.Add("Portfolio Name");

                    DataRow drEQTransaction;

                    for (int i = 0; i < dtTransactions.Rows.Count; i++)
                    {
                        drEQTransaction = dtEQTransactions.NewRow();


                        drEQTransaction["TransactionId"]  = dtTransactions.Rows[i]["CET_EqTransId"].ToString();
                        drEQTransaction["Customer Name"]  = dtTransactions.Rows[i]["Name"].ToString();
                        drEQTransaction["Scrip"]          = dtTransactions.Rows[i]["PEM_CompanyName"].ToString();
                        drEQTransaction["TradeAccNumber"] = dtTransactions.Rows[i]["CETA_TradeAccountNum"].ToString();
                        drEQTransaction["Type"]           = dtTransactions.Rows[i]["WETT_TransactionTypeName"].ToString();
                        if (dtTransactions.Rows[i]["CET_TradeDate"] != DBNull.Value)
                        {
                            //drEQTransaction["Date"] = dtTransactions.Rows[i]["CET_TradeDate"].ToString();
                            drEQTransaction["Date"] = Convert.ToDateTime(dtTransactions.Rows[i]["CET_TradeDate"].ToString()).ToShortDateString();
                        }

                        drEQTransaction["Rate"] = dtTransactions.Rows[i]["CET_Rate"].ToString();
                        if (dtTransactions.Rows[i]["CET_Quantity"] != DBNull.Value)
                        {
                            drEQTransaction["Quantity"] = Convert.ToInt32(dtTransactions.Rows[i]["CET_Quantity"]);
                        }
                        drEQTransaction["Brokerage"]               = dtTransactions.Rows[i]["CET_Brokerage"].ToString();
                        drEQTransaction["OtherCharges"]            = dtTransactions.Rows[i]["CET_OtherCharges"].ToString();
                        drEQTransaction["STT"]                     = dtTransactions.Rows[i]["CET_STT"].ToString();
                        drEQTransaction["Gross Price"]             = dtTransactions.Rows[i]["XES_SourceCode"].ToString();
                        drEQTransaction["Speculative Or Delivery"] = dtTransactions.Rows[i]["CET_IsSpeculative"].ToString();
                        drEQTransaction["Portfolio Name"]          = dtTransactions.Rows[i]["CP_PortfolioName"].ToString();

                        dtEQTransactions.Rows.Add(drEQTransaction);
                        totalBrokerage    += Convert.ToDouble(drEQTransaction["Brokerage"].ToString());
                        totalOtherCharges += Convert.ToDouble(drEQTransaction["OtherCharges"].ToString());
                        totalSTT          += Convert.ToDouble(drEQTransaction["STT"].ToString());
                    }

                    gvMFTransactions.DataSource = dtEQTransactions;
                    gvMFTransactions.DataBind();
                    gvMFTransactions.Visible = true;

                    if (genDictTranType.Count > 0)
                    {
                        DropDownList ddlTranType = GetTranTypeDDL();
                        if (ddlTranType != null)
                        {
                            ddlTranType.DataSource     = genDictTranType;
                            ddlTranType.DataTextField  = "Key";
                            ddlTranType.DataValueField = "Value";
                            ddlTranType.DataBind();
                            ddlTranType.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Select", "Select"));
                        }

                        if (hdnTranType.Value != "")
                        {
                            ddlTranType.SelectedValue = hdnTranType.Value.ToString().Trim();
                        }
                    }


                    GetPageCount();
                    mypager.Visible = true;
                }
                else
                {
                    gvMFTransactions.DataSource = null;
                    gvMFTransactions.DataBind();
                    hdnRecordCount.Value   = "0";
                    lblCurrentPage.Visible = false;
                    trPager.Visible        = false;
                    lblTotalRows.Visible   = false;
                    trMessage.Visible      = true;
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "RMMultipleEqTransactionsView.ascx.cs:BindGrid()");

                object[] objects = new object[1];
                // objects[0] = userVo;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }