Hi,
I am trying to hide a few fields which I do not want to show in the field chooser or in the grid but required to be binded to the grid.
I tried doing these in the column chooser opening event. But none of them worked.
e.FieldChooser.CurrentFields[0].Field.Visibility = Visibility.Collapsed;
e.FieldChooser.CurrentFields[0].IsVisible = false;
Can anyone provide me a solution to that I am using the Infragistics WPF XamDataGrid v9.2.
Thanks
can you be more specific how to set this property in code behind on Fieldchooseropening event
The AllowHiding setting is an easy way of doing this.
Thanks Alex
As an addition, note that you can set the AllowHinding property from the Settings of a specific field to prevent it from showing in the FieldChooser.
You can find more information on this in our help here.
For example, if you want to show only even fields:
void xamDataGrid1_FieldChooserOpening(object sender, Infragistics.Windows.DataPresenter.Events.FieldChooserOpeningEventArgs e)
{
Predicate<Field> evenFieldFilterCondition = new Predicate<Field>(field => { return (field.Index%2==0); });
FieldChooserFilter filter = new FieldChooserFilter("Description", evenFieldFilterCondition, "Even Fields");
e.FieldChooser.FieldFilters.Add(filter);
e.FieldChooser.CurrentFieldGroup = e.FieldChooser.FieldGroups[1];
}
Hi Alex,
Thanks for the reply. Can you you help me with some sample code to do the same. I am not able to add FieldChooserFilter to FieldFilter collection.