protected void SearchItems_Click(object sender, EventArgs e)
        {
            UpdatePagerSize();

            if (FieldItems.DataSource != null)
            {
                var items = ((List <FieldAssociation>)FieldItems.DataSource).Where(i => i.MediaDetail.SectionTitle.Contains(SearchText.Text)).ToList();

                FieldItems.DataSource = items;
                FieldItems.DataBind();
            }

            //switch (Mode)
            //{
            //    case ViewMode.GridView:
            //        {
            //            if (FieldItems.DataSource != null)
            //            {
            //                var items = ((List<FieldAssociation>)FieldItems.DataSource).Where(i => i.MediaDetail.SectionTitle.Contains(SearchText.Text)).ToList();

            //                FieldItems.DataSource = items;
            //                FieldItems.DataBind();
            //            }

            //            break;
            //        }
            //    default:
            //        {
            //            if (Values.DataSource != null)
            //            {
            //                var items = ((List<FieldAssociation>)Values.DataSource).Where(i => i.MediaDetail.SectionTitle.Contains(SearchText.Text)).ToList();

            //                Values.DataSource = items;
            //                Values.DataBind();
            //            }
            //            break;
            //        }
            //}
        }
 protected void ItemList_PageIndexChanging(object sender, System.Web.UI.WebControls.GridViewPageEventArgs e)
 {
     FieldItems.PageIndex = e.NewPageIndex;
     FieldItems.DataBind();
 }
        private void BindValues()
        {
            UpdatePagerSize();

            FieldItems.DataSource = GetValue();
            FieldItems.DataBind();

            if (((dynamic)FieldItems.DataSource).Count > 0)
            {
                SearchPanel.Visible = true;
            }
            else
            {
                SearchPanel.Visible = false;
            }

            /*switch (Mode)
             * {
             * case ViewMode.GridView:
             * {
             * //MultiItemUploaderPanel.Visible = false;
             * FieldItems.Visible = true;
             *
             * FieldItems.DataSource = GetValue();
             * FieldItems.DataBind();
             *
             * if(((dynamic)FieldItems.DataSource).Count > 0)
             * {
             *  SearchPanel.Visible = true;
             * }
             * else
             * {
             *  SearchPanel.Visible = false;
             * }
             *
             * break;
             * }
             * default:
             * {
             * //MultiItemUploaderPanel.Visible = true;
             * FieldItems.Visible = false;
             *
             * Values.DataSource = GetValue();
             * //Values.DataBind();
             *
             * if (((dynamic)Values.DataSource).Count > 0)
             * {
             *  SearchPanel.Visible = true;
             * }
             * else
             * {
             *  SearchPanel.Visible = false;
             * }
             *
             * break;
             * }
             * }*/


            ItemsToDelete.Text = "[]";
            ReorderItems.Text  = "[]";
        }