protected DataView GetData()
        {
            BPImageCategories bp = new BPImageCategories();

            if (ShowGalleries)
                DSImages = bp.SelectAllGalleries();
            else
                DSImages = bp.SelectAllNonGallery();

            string rowFilter = "";
            rowFilter = RowFilter("ImageCategoryName", ((LinkButton)rptLetters.Items[0].FindControl("lnkLetter")).CommandName, "ImageCategoryActive", lstActive.SelectedValue);

            DSImages.tbl_ImageCategories.DefaultView.RowFilter = rowFilter;

            DSImages.tbl_ImageCategories.DefaultView.Sort = DSImages.tbl_ImageCategories.ImageCategoryNameColumn.ColumnName;
            return DSImages.tbl_ImageCategories.DefaultView;
        }
Example #2
0
        protected void BindDropDownFilters()
        {
            BPImageCategories bp = new BPImageCategories();
            BEImages dsImageCategories = new BEImages();

            //galleries dropdown
            dsImageCategories = bp.SelectAllGalleries();
            dsImageCategories.tbl_ImageCategories.DefaultView.Sort = "ImageCategoryName";

            ddlImageGalleries.DataSource = dsImageCategories.tbl_ImageCategories.DefaultView;
            ddlImageGalleries.DataTextField = "ImageCategoryName";
            ddlImageGalleries.DataValueField = "ImageCategoryID";
            ddlImageGalleries.DataBind();

            ddlImageGalleries.Items.Insert(0, new ListItem(" (All Galleries) ", "-1"));
            ddlImageGalleries.Items.Insert(1, new ListItem("Not Assigned", "0"));

            if (FilterCatID != "-1")
                if (ddlImageGalleries.Items.FindByValue(FilterCatID) != null)
                    ddlImageGalleries.SelectedValue = FilterCatID;

            //categories dropdown
            dsImageCategories.Clear();
            dsImageCategories = bp.SelectAllActiveNonGallery();
            dsImageCategories.tbl_ImageCategories.DefaultView.Sort = "ImageCategoryName";

            ddlImageCategories.DataSource = dsImageCategories.tbl_ImageCategories.DefaultView;
            ddlImageCategories.DataTextField = "ImageCategoryName";
            ddlImageCategories.DataValueField = "ImageCategoryID";
            ddlImageCategories.DataBind();

            ddlImageCategories.Items.Insert(0, new ListItem("(All Categories)", "-1"));
            ddlImageCategories.Items.Insert(1, new ListItem("Not Assigned", "0"));

            if (FilterCatID != "-1")
                if (ddlImageCategories.Items.FindByValue(FilterCatID) != null)
                    ddlImageCategories.SelectedValue = FilterCatID;
        }