private void GetRecipes() { string submitted_by = SubmittedBy.SelectedValue; string category = Category.SelectedValue; string name_ingredient = Ingredient.SelectedValue; RecipeGridView.DataSource = GetRecipesSubmittedBy_Category_Ingredient(submitted_by, category, name_ingredient); RecipeGridView.DataBind(); }
protected void ButtonClear_Click(object sender, EventArgs e) { ClearAllGridviews(); SetAllCheckBoxes(); using (Models.PlanMyDinnerDbContext database = new Models.PlanMyDinnerDbContext()) { //Using TemplateFields in the GridView Control // https://msdn.microsoft.com/en-us/library/bb288032.aspx RecipeGridView.DataSource = database.Recipes.ToList(); RecipeGridView.DataBind(); } ltRecipe.Text = "Showing all available recipes"; }
/************************************************************************* * * GUI update methods * * ***********************************************************************/ protected void ClearAllGridviews() { RecipeGridView.DataSource = null; RecipeGridView.DataBind(); IngredientGridView.DataSource = null; IngredientGridView.DataBind(); CategoryGridView.DataSource = null; CategoryGridView.DataBind(); ContextGridView.DataSource = null; ContextGridView.DataBind(); ltInstructions.Text = "Please select recipe to view recipe details."; Gv_imgs.DataSource = null; Gv_imgs.DataBind(); }
protected void UpdateRecipeGrid(IQueryable <Models.Recipe> recipes) { RecipeGridView.DataSource = recipes.ToList(); RecipeGridView.DataBind(); }