예제 #1
0
        private void BindGrid(int status, bool isneeddatasource)
        {
            DataTable reqList = null;

            if (status == 12 || status == 20)
            {
                int roleId   = Convert.ToInt32(Session["roleId"]);
                int daneshId = business.GetDaneshKadeIdByRoleId(roleId);
                if (daneshId == 0)
                {
                    reqList = business.GetListOFRequestByCurrentStatus(status);
                }
                else
                {
                    reqList = business.GetListOFRequestByCurrentStatusDaneshId(status, daneshId);
                }
            }
            else
            {
                reqList = business.GetListOFRequestByCurrentStatus(status);
            }
            ViewState.Add("status", status);
            grd_CheckOutList.DataSource = reqList;

            if (!isneeddatasource)
            {
                grd_CheckOutList.DataBind();
            }
            GridFilterMenu menu = grd_CheckOutList.FilterMenu;

            if (menu.Items.Count > 3)
            {
                int im = 0;
                while (im < menu.Items.Count)
                {
                    if (menu.Items[im].Text == "NoFilter" || menu.Items[im].Text == "Contains" || menu.Items[im].Text == "EqualTo")
                    {
                        im++;
                    }
                    else
                    {
                        menu.Items.RemoveAt(im);
                    }
                }
                foreach (RadMenuItem item in menu.Items)
                {    //change the text for the "StartsWith" menu item
                    if (item.Text == "NoFilter")
                    {
                        item.Text = "حذف فیلتر";
                        //item.Remove();
                    }
                    if (item.Text == "Contains")
                    {
                        item.Text = "شامل";
                        //item.Remove();
                    }
                    if (item.Text == "EqualTo")
                    {
                        item.Text = "مساوی با";
                        //item.Remove();
                    }
                }
            }
        }