I have several Silverlight pages that use the XamGrid along with data retrieved thru a DomainDataSource. We noticed that we had an issue on some of these pages, when the data is editable. We experienced this problem with 2012.1 (last service release), but confirmed also in 2012.2 - so maybe other versions are affected.
If a cell in almost any row is edited, and while the cell is in EditMode the user clicks on a button outside of the grid (for example, to save/submit changes to the DomainDataSource entities), then the cell goes thru the EndEdit, stays selected and active, and the button click event is fired.
If, however, the cell edited is in the last row of the grid, the cell goes thru the EndEdit, but the first cell of the row becomes active, and the button click event is lost.
After lots of investigation, the issue appears to be in the XamGrid source, and is related to how the XamGrid handles data from a DomainDataSource. When the EndEdit calls "CommitEdit" thru the DataManager, the IEditableCollectionViewData.CommitEdit() for the underlying DomainDataSource object is called. The DDS appears to switch the 'current' item to the previous item, and then back, during this commit. This in turn triggers the ActiveItemChanged callback in the XamGrid (which perhaps should be ignored?). There is a line in this code that calls ResolveIndexForRecord() of the DataManager for the new 'current' item, which returns inconsistent results from the DDS, and appears to cause the bug.
I am trying to work around this issue by using the underlying EntitySet from the DDS as the ItemsSource for now, but I may be losing features of the DDS that I need. Is there any chance for an investigation and/or possible fix?
Hello Rob,
Thank you for your post.
While I personally have not had too much experience in using the XamGrid with a domain data source, I am currently investigating into this issue you are seeing. I am in the process of creating a sample project to test this behavior that you are seeing, and I should have more information for you on this matter soon.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thank you Andrew,
Please let me know if you have more details. We have an intermediate release planned shortly, and would prefer to have this resolved without a workaround.
Best Regards,
Rob Vickers
Thanks Andrew,
I will do my best to verify or refute the case, and will let you know as soon as I am able. Thank you for your assistance. If I see significant differences, I will modify your sample to the best of my ability to match to see if I can then reproduce the problem.
Rob
Thank you for your response. I will continue to monitor this forum thread while you test the sample project I had sent you. I look forward to your next response.
Hello Andrew,
I was able to test the sample project, and I was able to reproduce the issue with a small addition. I'm unsure what difference this makes to the grid, but the issue will appear.
In the DomainDataSource, set the PageSize to 10000. (I.e., per the example:)
<riaControls:DomainDataSource x:Key="domainDataSource1" Name="domainDataSource1" PageSize="10000" AutoLoad="True" QueryName="GetDimEmployeesQuery" LoadedData="domainDataSource1_LoadedData">
<riaControls:DomainDataSource.DomainContext>
<loc:AdventureWorksDomainContext/>
riaControls:DomainDataSource.DomainContext>
riaControls:DomainDataSource>
Please let me know if this permits you to reproduce the problem on your end. If not, I can send you my solution.
I have modified my sample project to include the PageSize="10000" declaration, and I am now able to reproduce this issue you are seeing. I am just performing a few final tests on this matter, but this appears to be a bug in the XamGrid. I should have more information for you on this matter very soon.
Thank you for your response. No other questions at this time. I would appreciate any information that you could provide. If a fix is released for current versions, and if that fix has potential workarounds for earlier versions, I would appreciate as much detail as you can provide.
I have been investigating into this a bit further, and this does appear to me to be a bug in the XamGrid. This is rather unexpected behavior, and as such, I have asked our engineering staff to investigate further. To ensure that it receives attention, I have logged this in our internal tracking system with a development ID of 213028.
I have created you a private support case on this matter, which will be linked to this issue so that you can be notified when changes to this issue are made. This case has an ID of CAS-168934-J9C9V0 and you can access it here: https://ko.infragistics.com/my-account/support-activity.