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; } }
Hello Gary,
Thank you for your post. I have been looking into it and I tested your scenario with both the RTM (14.1.20141.1015) and latest (14.1.20141.2192) service release of version 14.1 and everything seems to work ok on my side. Could you please tell me the exact version you are using?
Looking forward for your reply.
Thanks for looking into this.
My version is 14.1.20141.1015
When you expand out the XamDataGrid's Group By box, are you saying that you see "Test 1" in there? Strange - we're seeing this on numerous machines, and with previous Infragistics releases.
Just to make it clear, this second screenshot is what's seen after clicking on the "Test 2" button to sort by it. Doing this gets the grid to realize that it actually has a grouping by "Test 1" and it gets displayed in the Group by pane.
oops, I meant "click on the Test 2 COLUMN HEADER"
Could you please try to install the latest service release of version 14.1 and see if the issue still occurs. You can download the Service Releases by logging to our web site and going to Account \Keys & Downloads.
https://www.infragistics.com/my-account/keys-and-downloads/
Hi Stefan,
I'm on a trial license so I don't see any service releases on that page. Strange that you're not seeing the issue here when using the 14.1 initial release...
Thanks,
Gary
I can suggest you uninstall the NetAdvantage and install it again, but when you open the installer before you click install, look for a checkbox saying "Always download and install the latest service release", when you check it the new installation will be of the latest SR, but please check again when you open your solution.
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
I haven't had time to uninstall and reinstall Infragistics yet. I'm hoping to in the next day or so.
Thanks,Gary
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.
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://www.infragistics.com/Membership/Default.aspx?panel=Downloads#Downloads
You can also monitor the support ticket’s progress through the “My Support Activity” tag: https://www.infragistics.com/Membership/MySupport.aspx
That's great - thanks for your help Stefan!