Ejemplo n.º 1
0
        private void bindProfGrid(bool isNeedDataSource)
        {
            DataTable prof = new DataTable();

            if (!isNeedDataSource)
            {
                prof = clsB.getActiveProfName();
                ViewState.Add("prof", prof);
                grdProf.DataSource = prof;
                grdProf.DataBind();
                GridFilterMenu menu = grdProf.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();
                        }
                    }
                }
            }
            else
            {
                prof = (DataTable)ViewState["prof"];
                grdProf.DataSource = prof;
            }
        }