protected void grdLibAttributesGroups_Sorting(object sender, GridViewSortEventArgs e) { AttributeSettingsClient oClient = new AttributeSettingsClient(ServiceConfig.AttributeSettingsDataEndPoint(), ServiceConfig.AttributeSettingsDataUri()); List <AttributeService.AttributeSettingsData> oList = new List <AttributeSettingsData>(); oList = oClient.GetAttributeGroupByLibraryId(ViewState["LibraryId"].ToString().ToInt()); DataTable dtSortTable = new DataTable(); dtSortTable = Common.ToDataTable(oList); if (dtSortTable != null) { DataView dvSortedView = new DataView(dtSortTable); dvSortedView.Sort = e.SortExpression + " " + ViewState["SortDirection"].ToString(); grdLibAttributesGroups.DataSource = dvSortedView; grdLibAttributesGroups.DataBind(); if (ViewState["SortDirection"] != null) { if (ViewState["SortDirection"].ToString() == "DESC") { ViewState["SortDirection"] = "ASC"; } else { ViewState["SortDirection"] = "DESC"; } } } }
private void SearchGridFill() { AttributeSettingsClient oClient = new AttributeSettingsClient(ServiceConfig.AttributeSettingsDataEndPoint(), ServiceConfig.AttributeSettingsDataUri()); grdAttribute.DataSource = oClient.GetFullAttributeList("A", txtSearch.Text.Trim()); grdAttribute.DataBind(); }
private void FillLibraryAttributesGroups() { if (ViewState["LibraryId"] != null) { AttributeSettingsClient oClient = new AttributeSettingsClient(ServiceConfig.AttributeSettingsDataEndPoint(), ServiceConfig.AttributeSettingsDataUri()); grdLibAttributesGroups.DataSource = oClient.GetAttributeGroupByLibraryId(ViewState["LibraryId"].ToString().ToInt()); grdLibAttributesGroups.DataBind(); } }