public void BindFBMAccessRight()
    {
        try
        {
            int rowcount = ucCustomPagerItems.isCountRecord;

            string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }

            DataTable dt = BLL_FBM_Report.FBM_Get_RankList_Search(txtSearchBy.Text, UDFLib.ConvertIntegerToNull(ddlRank.SelectedValue), UDFLib.ConvertIntegerToNull(ddlRankCategory.SelectedValue)
                                                                  , sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);

            if (ucCustomPagerItems.isCountRecord == 1)
            {
                ucCustomPagerItems.CountTotalRec = rowcount.ToString();
                ucCustomPagerItems.BuildPager();
            }

            gvFBMAcessRight.DataSource = dt;
            gvFBMAcessRight.DataBind();
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
    protected void btnExport_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            int    rowcount      = ucCustomPagerItems.isCountRecord;
            string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }

            DataTable dt = BLL_FBM_Report.FBM_Get_RankList_Search(txtSearchBy.Text, UDFLib.ConvertIntegerToNull(ddlRank.SelectedValue), UDFLib.ConvertIntegerToNull(ddlRankCategory.SelectedValue)
                                                                  , sortbycoloumn, sortdirection, null, null, ref rowcount);

            string[] HeaderCaptions  = { "Rank Name", "Rank Short Name", "Read Access" };
            string[] DataColumnsName = { "Rank_Name", "Rank_Short_Name", "READ_ACCESS_FLAG" };

            GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "FBMReadAccess", "FBM Read Access");
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }