private void BindWithFilter(List <NewsGridItem> items) { //search for filter expression else search default which is all items. if (!string.IsNullOrEmpty(FilterExpression)) { Bind(); List <NewsGridItem> itemList = (List <NewsGridItem>)RadGridManage.DataSource; if (FilterExpression.Contains(",")) { string[] values = FilterExpression.Split(','); foreach (string cat in values) { AddNewsToList(items, cat.Trim(), itemList); } } else { if (!string.IsNullOrEmpty(FilterExpression)) { AddNewsToList(items, FilterExpression.Trim(), itemList); } } RadGridManage.DataSource = GetAccessibleList(items); } else { SearchDefault(items); } }
/// <summary> /// Binds radgrid to a new DS using results based on filter expression. Filter expression is typed into filter textbox on RadGrid. /// </summary> /// <param name="personsAndUsers"></param> protected void BindWithFilter(List <PersonWithUser> personsAndUsers) { if (!string.IsNullOrEmpty(FilterExpression)) { //comma seperated list if (FilterExpression.Contains(",")) { string[] values = FilterExpression.Split(','); foreach (string cat in values) { AddSiteToList(personsAndUsers, cat); } } //single value else { if (!string.IsNullOrEmpty(FilterExpression)) { AddSiteToList(personsAndUsers, FilterExpression); } } RadGrid1.DataSource = personsAndUsers; currentDS = personsAndUsers; } else { SearchDefault(personsAndUsers); } }
private static LoadModifiers GetPropertyContainsLoadModifiers(string propertyString, string identifier) { var filter = LoadModifiers.Create(); var property = FilterExpression.Property(propertyString); var value = FilterExpression.StringConstant(identifier); var filterParams = FilterExpression.Contains(property, value); filter.Filters = filterParams; return(filter); }
private void LoadSalesOrderFromName(string salesOrderReference, out SalesOrderList salesOrderLines) { salesOrderLines = Company.Factories.SalesOrderFactory.List(); var filter = LoadModifiers.Create(); var property = FilterExpression.Property("SalesOrder.ReferenceNumber"); var value = FilterExpression.StringConstant(salesOrderReference); var filterParams = FilterExpression.Contains(property, value); filter.Filters = filterParams; salesOrderLines.Load(filter); }