protected void gvFSource_Sorting(object sender, GridViewSortEventArgs e) { SortExpression = e.SortExpression; DataTable dt = FundingSourceData.GetFundingSource(); SortDireaction = CommonHelper.GridSorting(gvFSource, dt, SortExpression, SortDireaction); }
protected void BindFundingSource() { try { gvFSource.DataSource = FundingSourceData.GetFundingSource(); gvFSource.DataBind(); } catch (Exception ex) { lblErrorMsg.Text = ex.Message; } }
protected void btnSubmit_Click(object sender, ImageClickEventArgs e) { try { FundingSourceData.AddFSName(txtFName.Text); BindFundingSource(); } catch (Exception ex) { lblErrorMsg.Text = ex.Message; } }
protected void gvFSource_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { int rowIndex = e.RowIndex; int nameId = Convert.ToInt32(((Label)gvFSource.Rows[rowIndex].FindControl("lblFundId")).Text); string fSourceName = ((TextBox)gvFSource.Rows[rowIndex].FindControl("txtName")).Text; FundingSourceData.UpdateFSource(fSourceName, nameId); gvFSource.EditIndex = -1; lblErrorMsg.Text = "Name updated successfully"; txtFName.Text = ""; gvFSource.PageIndex = 0; BindFundingSource();; } catch (Exception ex) { lblErrorMsg.Text = ex.Message; } }
protected void BindGridWithSort() { DataTable dt = FundingSourceData.GetFundingSource(); SortDireaction = CommonHelper.GridSorting(gvFSource, dt, SortExpression, SortDireaction != "" ? ViewState["SortDireaction"].ToString() : SortDireaction); }