Hello,
We are using a xamDataGrid 11.1 in a UserControl. We want to enable users to select the fields that displayed on the screen using the field chooser.
At the beginning, we had a problem because we wanted to add 3 buttons (for configuration save, load and default) under the field list (In the field chooser pop-up). We solved this by creating a separate UserControl containing a FieldChooser control and 3 buttons under it. The constructor of the that UserControl receives a XamDataGrid and set it as the DataPresenter of the FieldChooser.
We are using the new UserControl for several other UserControls in our project. In some of the xamDataGrid, we don't want to show all of the fields in the field chooser so we are using a filer:
private void m_FieldChooser_Loaded(object sender, RoutedEventArgs e)
{
m_FieldChooser.FieldFilters.Clear();
FieldChooserFilter filter;
filter = GetFieldFilet();
m_FieldChooser.FieldFilters.Add(filter);
m_FieldChooser.CurrentFieldGroup = m_FieldChooser.FieldGroups[1];
}
private FieldChooserFilter GetFieldFilet()
Predicate<Field> evenFieldFilterCondition = new Predicate<Field>(field => { return (IsFieldVisible(field)); });
FieldChooserFilter filter = new FieldChooserFilter("Fields selection", evenFieldFilterCondition, "");
return filter;
private bool IsFieldVisible(Field field)
if (m_FieldsToHide != null)
foreach (Field item in m_FieldsToHide)
if (item == field)
return false;
return true;
All of this works fine when we are using it on a one level XamDataGrid (Only 1 field layout). When we are using it on a 2 level grid, we have several issues:
I would like to do the same as above, automatically display the current field group, based on the datacontext of the XamDataGrid.
As the data loaded in the grid changes, there are different sets of fields to choose from.
I have looked at the FieldGroups property but events i have tried thus far occur prior to FieldGroups update to include the new group. When is this property updated and what event can i use to catch after the new group is available?
Hi Kresimir,
Is there any way to get the Reference of field-group selector control reference from field chooser control. I want to disable the drop down list and show only the current field group.
Looking forward to hear from you soon.
Thanks,
S.Balamurugen.
No Krasimir, I don't require any further assistance on the matter.
Thank you very much
I am just checking if you require any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
I have been looking into the functionality that you are trying to achieve and I can suggest re-templating the FieldChooser instead of creating a new UserControl. I have created a sample applicaiotn which shows how you can re-template the FieldChooser in order to add three buttons in in. Also I handled the FieldChooserOpening event in order to add a FieldChooserFilter to the FieldChooser. You can use one FieldChooserFilter for the all both of your FieldLayouts.
In order to change the group display text in the GroupSelector for each FielLayout by setting the Description property of the FieldLayout. I have added this in the attached sample applicaiotn. Also in order to disallow the user to select the unfiltered groups I have added a Style for the ComboBoxItem in the Resources section of the XamComboEditor which is used for the GroupSelector. I have added a Setter for the IsEnabled property which is set to false if the group corresponds to ComboBoxItem is unfiltered, using a converter.
If you need any further assistance please do not hesitate to ask.