Hello,In the attached sample I have a Xam grid containing a Section column. some items in this column have an emty value. So In this column I want filter all other values to have just the empty values dsplayed in xam Grid.
how I can do please.
Thanks.
Regards
Hello Anis,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Its ok I use it like this:
in XamGridFilterBehavior
protected override void OnAttached() { base.OnAttached(); Grid.Loaded += Grid_Loaded; }
protected override void OnDetaching() { base.OnDetaching(); Grid.Loaded -= Grid_Loaded; }
void Grid_Loaded(object sender, RoutedEventArgs e) { var typeOfCollection = (Grid.ItemsSource as System.Collections.ICollection).AsQueryable().ElementType; var nullFilterOperandType = typeof (NullFilterOperand<>); var notNullFilterOperandType = typeof(NotNullFilterOperand<>);
var nullType = nullFilterOperandType.MakeGenericType(typeOfCollection); var notNullType = notNullFilterOperandType.MakeGenericType(typeOfCollection);
foreach (var column in Grid.Columns.OfType<CustomTemplateColumn>()) { Grid.Columns.DataColumns[column.Key].FilterColumnSettings.RowFilterOperands.Add((FilterOperand)Activator.CreateInstance(nullType, column.FilterColumn)); Grid.Columns.DataColumns[column.Key].FilterColumnSettings.RowFilterOperands.Add((FilterOperand)Activator.CreateInstance(notNullType, column.FilterColumn)); }
}
and in CustomTemplateColumn
public string FilterColumn { get { return (string)GetValue(FilterColumnProperty); } set { SetValue(FilterColumnProperty, value); } }
public static readonly DependencyProperty FilterColumnProperty = DependencyProperty.Register( "FilterColumn", typeof(string), typeof(CustomTemplateColumn), null); }
Thanks
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
Thank you for your post. I have been looking into it and the sample you have provided and I modified it, so now it has the functionality you want. Basically I followed the steps described in this link from our online documentation:
http://help.infragistics.com/NetAdvantage/Silverlight/2013.1/CLR4.0/?page=xamGrid_Create_a_Custom_Filter.html
about creating custom filter. I created filters for “Blanks” and “Not Blanks”. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.