I've got a grid that I've applied a grouping to - by setting the FieldLayout's SortedFields.
See example code below.
The SortedFields are applied correctly - can see that the groupings are applied in the grid, but on clicking the expander, can't see any of the groupings in the group by area. If you then click on column "Test 2" to sort by it, then "Test 1" grouping appears in the group by area.
I think it's an ordering issue
1) Set DataSource 2) Set Fields 3) Set SortedFields - works fine
1) Set DataSource 2) Set SortedFields 3) Set Fields - the symptoms above occur
1) Set SortedFields 2) Set DataSource 3) Set Fields - the symptoms above occur
1) Set Fields 2) Set SortedFields 3) Set DataSource - works fine
The docs for 12.1 say that when populating SortedFields, if the field is not present then an exception is thrown. I can't seem to find any docs saying that's the case for 14.1, an exception isn't thrown, but the current behavior isn't 100% if the SortedFields are set before the Fields are populated.
(Sorry for the formatting - I don't have permission to upload attachments, and I can't see an option to paste code in your editor - the formatting should be OK if copy and paste into Visual Studio)
MainWindow.xaml:
<igWPF:XamDataGrid x:Name="grid"> <igWPF:XamDataGrid.FieldLayoutSettings> <igWPF:FieldLayoutSettings AutoGenerateFields="False" HeaderPlacementInGroupBy="OnTopOnly"></igWPF:FieldLayoutSettings> </igWPF:XamDataGrid.FieldLayoutSettings> <igWPF:XamDataGrid.FieldSettings> <igWPF:FieldSettings AllowEdit="False" CellClickAction="SelectCell" AllowGroupBy="True" /> </igWPF:XamDataGrid.FieldSettings> </igWPF:XamDataGrid>
MainWindow.xaml.cs:
public partial class MainWindow { public MainWindow() { InitializeComponent();
Loaded += MainWindow_Loaded; }
void MainWindow_Loaded(object sender, RoutedEventArgs e) { SetDataSource();
SetSortedFields();
SetFields(); }
private void SetFields() { if (grid.DefaultFieldLayout == null) { grid.FieldLayouts.Add(new FieldLayout()); }
// NOTE: This line is necessary for the sorted fields to be applied if set // before fields grid.DefaultFieldLayout.Fields.Clear();
grid.DefaultFieldLayout.Fields.Add( new Field { Name = "Test1", Label = "Test 1" });
grid.DefaultFieldLayout.Fields.Add( new Field { Name = "Test2", Label = "Test 2" }); }
private void SetSortedFields() { if (grid.DefaultFieldLayout == null) { grid.FieldLayouts.Add(new FieldLayout()); }
grid.DefaultFieldLayout.SortedFields.BeginUpdate(); grid.DefaultFieldLayout.SortedFields.Add( new FieldSortDescription("Test1", ListSortDirection.Ascending, true)); grid.DefaultFieldLayout.SortedFields.EndUpdate(); }
private void SetDataSource() { grid.DataSource = new List<ItemVm> { new ItemVm {Test1 = "A", Test2 = 1.0}, new ItemVm {Test1 = "B", Test2 = 2.0}, new ItemVm {Test1 = "A", Test2 = 3.0}, }; } }
public class ItemVm { public string Test1 { get; set; } public double Test2 { get; set; } }
Hi Stefan,I encountered the behaviour reported by Gary with Infragistics WPF service release 14.2.20142.2081.
I noticed that if I set grid.GroupByAreaMulti = null; the issue is solved: fields are correctly displayed on the area.Unfortunately I need to customize GroupByArea style and then I cannot set GroupByAreaMulti to null.
Do you think that the release I'm using should work or not? Do you have any workaround?I cannot upgrade to the latest release at the moment.
Thank you. Maria
Hello Gary,
We have shipped out a new service release where your issue is resolved. I'd be glad to find out if you had tested it out and if it had met your requirements.
You can download the Service Releases by logging to our web site and going to Account \Keys & Downloads.
https://es.infragistics.com/my-account/keys-and-downloads/
That's great - thanks for your help Stefan!
I was able to reproduce your behavior and I have logged this with development under ID: 185943 and I have also created a support ticket on your behalf: CAS-147315-R3J4H2 and have linked the development issue to it, so that you can get automatically updated, when a Service Release containing the fix is available for download. You can get the new version from our website’s “My IG”, “My Keys & Downloads” tags: https://es.infragistics.com/Membership/Default.aspx?panel=Downloads#Downloads
You can also monitor the support ticket’s progress through the “My Support Activity” tag: https://es.infragistics.com/Membership/MySupport.aspx
Hi Stefan,
I've just ininstalled and reinstalled NetAdvantage. I used the offline installer, due to company firewall.
I didn't see a checkbox "Always download and install the latest service release", the installer itself said that there were no updates available.
I also made sure that the Visual Studio extension is installed, which is supposed to indicate if there are any updates? No updates are showing up in the Extensions and Updates screen in Visual Studio.
Thanks,
Gary