예제 #1
0
        private void BindProductCategory()//绑定产品分类数据到下拉菜单
        {
            DataSet ds = ProductCategoryDAL.SelectProductCategory();

            dwlProductCategory.DataSource     = ds.Tables[0].DefaultView;
            dwlProductCategory.DataTextField  = "ProductCategoryName";
            dwlProductCategory.DataValueField = "ProductCategoryId";
            dwlProductCategory.DataBind();
        }
예제 #2
0
        //绑定产品分类数据到下拉菜单
        private void BindProductCategory()
        {
            DataSet ds = ProductCategoryDAL.SelectProductCategory();

            dwlProductCategory.DataSource     = ds.Tables[0].DefaultView;
            dwlProductCategory.DataTextField  = "ProductCategoryName";
            dwlProductCategory.DataValueField = "ProductCategoryId";
            dwlProductCategory.DataBind();
            ListItem item = new ListItem("全部", "全部");

            dwlProductCategory.Items.Add(item);
            dwlProductCategory.SelectedIndex = dwlProductCategory.Items.Count - 1;
        }