private void BindRecipeData() { try { DataTable dtu = con.SelecthostProc(Com_username, "Recipe_View_Select", null, null); GridView_Recipes.DataSource = dtu; GridView_Recipes.DataBind(); } catch (Exception ex) { con.ExcutehostProc(Com_username, "Log_Issues", new string[] { "msg", "details" }, ex.Message, "Err-Recipes-BindRecipeData"); } }
protected void GridView_Recipes_PageIndexChanging(object sender, GridViewPageEventArgs e) { try { BindRecipeData(); GridView_Recipes.PageIndex = e.NewPageIndex; GridView_Recipes.DataBind(); NotifyMsg("", "none", ""); } catch (Exception ex) { con.ExcutehostProc(Com_username, "Log_Issues", new string[] { "msg", "details" }, ex.Message, "Err-Recipes-GridView_Recipes_PageIndexChanging"); } }
protected void GridView_Recipes_Sorting(object sender, GridViewSortEventArgs e) { try { DataTable dtu = con.SelecthostProc(Com_username, "Recipe_View_Select", null, null); if (dtu != null) { DataView dataView = new DataView(dtu); dataView.Sort = e.SortExpression + " " + ConvertSortDirectionToSql(e.SortDirection); GridView_Recipes.DataSource = dataView; GridView_Recipes.DataBind(); } } catch (Exception ex) { con.ExcutehostProc(Com_username, "Log_Issues", new string[] { "msg", "details" }, ex.Message, "Err-Recipes-GridView_Recipes_Sorting"); } }