Hi,
I'm facing a problem in implementing the following scenario:
When the user selects a record in a XamDataGrid, the control flows into another tab showing the details of the selected record.
The way I have done this is:
At the selection change of the XamDataGrid, I'm sending index of the tab to be activated using MVVM Light Messenger.
Setting the property bound to the Seledted Index of the Tab Control to that number.
Everything works smooth till here. Afetr that if I go back to the tab containing the grid, somehow the control comes back to tab which was activated.
As if, some intrinsic selection of cells in happening in the grid. Does Hover also affects the selection of the xamdatagrid?
I'm new to Infragistics and kind of confused. If some one can help.
All code are in View Model files and no code in the code behind of xaml file.
Cheers,
Anshuman
Hello Anshuman,
I have been reading through your description and am not quite sure what you have in mind. Please correct me if I am wrong – I understand you have XamTabContol with two tabs: one for the items and one for details. You have bound the selected tab’s index, so you can switch between tabs from your model and you are unable to switch back to the items tab?
Please let me know if I have understood your issue correctly, or if I’ve misunderstood you in any way.
Hi Petar,
You got it right. I have two tabs. One which has a xamdatagrid and shows some results. When I click on one record on that grid, I want the details to be shown and the control to be passed to the details tab.
That I can achieve. I have bound the Active Cell of the Data grid to a property in the view model and in the setter of the property, I'm sending a messenger string to the tab control vm page, which in turns changes the selected tab.
But, then what's happening is that as soon as I come back to the items tab to make another selection, I just can't stay on that tab. It takes me back to the details tab. As if some kind of selection is happening automatically and the setter called and which in turn sends the msg to tab control vm page and selected tab changes.
Please help!
Anshuman ChakravartyHumana Inc.Green Bay, WI
Hi Anshuman,
I have spent some time on this and what you have described seems expected to some extent. Usually the XamTabControl (just like the MS TabControl) is designed to have a single content are that unloads/loads different content based on the tab header that’s been selected. I assume that when you switch to the items tab and the XamDataGrid is loaded your ActiveCell binding is triggered thus resulting in going again to your details tab. Usually this should be easily overcome with a bool flag that would notify if a tab header or cell has been clicked. Of course all this is just a hunch, since I haven’t seen your code and of course if you want I can have a look at it in order to provide you with a more accurate response.
Please let me know if I can be of any further assistance on the matter.
Thanks for your response.
But I don't think its that simple. The bool variable will behave as you expect it to, but still the same thing will occur. It is a genuiene case of selection of row which is happening as I'm coming back to the grid. So it will still go back to the Info grid.
The problem here is due to the intrinsic behavior of the XamDataGrid. The selection is happening at hover, even before I click on a record. Thats where the problem is.
Tell me how to disable cell/record selection at hover and the problem will be solved!!!
Usually there is no built-in functionality that would provide selection when hovering, so this must be caused by something else in your code.
Please let me know if you can comply with my previous suggestions, or if you can provide me a sample that reproduces your scenario.
Looking forward to hearing from you.
Hi Peter,
I did solve the problem but had to give up with all the hover animations and effects.
You guys can investigate this problem. Selection was indeed happening at hover I guess. I have removed all hover effects and now it works as expected.
Thanks a lot for your suggestions.
Cheers,Anshuman
I am really glad to hear this worked out for you and gain, I’d like to point out that there is no hover-selection-functionality in our XamDataGrid whatsoever. I can only imagine that your implementation has led to this behavior, however without looking into it there isn’t much we can do.
Let us know if we can do anything else for you.