Hi,
I have recently upgraded my project from Silverlight 4 to Silverlight 5. I was using Infragistics 2011 vol 1 previously which I've uninstalled and installed 2012 vol 2. The project was not giving any compilation/run-time error before up-gradation. During upgrade process I didn't change any XAML or C# source code, but simply changed Infragistics dll references. When I executed the project, I see following exception. I could not find the exact location of exception in debugging mode.
Could someone please help me in this?
Hello Rohan,
Thank you for your post. I have been looking into it but since this is not a known issue, I am not able to conclude what can cause such behavior, so could you please send an isolated sample project, where the issue is reproduced, so I can investigate it further for you.
Looking forward for your reply.
Hi Stefan,
Thanks for your reply...
When I was using Infragistics 2011 version, there used to be "InfragisticsSL4.Controls.Editors.v11.2" dll reference in my project. Now, in 2012 vol 2, I could not find that dll to refer to. Could you please guide me on this? I don't know if that has caused any problem or not, I'm simply trying to find out the possibility...
Thanks and Regards,
Rohan
This assembly is not required for the XamRibbon and the exception you have is related to the QuickAccessToolbar. In order to have more details about the exception I can suggest you enable the Common Language Runtime Exceptions by opening Debug -> Exceptions… -> and tick the Common Language Runtime Exceptions by opening Debug. After doing that you will be able to get more information about the exception.
As per your suggestion, I enabled Common Language Runtime Exceptions and what I observed is attached.
Thanks & Regards,
Hi Rohan,
I'm glad to see your issue is resolved. As for the Customizations feature - it's an integral part of the XamRibbon control since version 2012.1. You can learn more about it here: http://help.infragistics.com/NetAdvantage/Silverlight/2012.1/CLR4.0/?page=xamRibbon_xamRibbon_User_Customization_Interface_Ribbon_And_QAT_Customization_Dialog.html.
When this feature was added it introduced some changes in ribbon's default template (and also brought some new dependencies - the XamRibbon now depends on few other controls and frameworks - XamMenu, XamDataTree and Drag&Drop fw).
Unfortunatelly, such changes often have a chance to break existing applications that make use of customized templates from older versions after upgrade. Basically, we introduced a new template part which was missing in your template.
Regards,
Hi Georgei,
Thanks a lot my friend.... You have solved my problem....Many many thanks....
I have now used customization dialog template in my code now and it is NOT giving me the exception.... :) I copied one style from infragisitc's sample source code for RibbonCustomizationDialogWindow to my code and it worked like a charm... ;)
By the way, I am wondering, if it is mandatory to set that property, is there any place where Infragistics talks about it? I mean, how would I know all such properties which Infragistics expects to be "NOT NULL"?
Once again thanks...
rohanb said: I've also set the customization dialog propety to null in xaml but that didn't help me; the exception still occurs.
I've also set the customization dialog propety to null in xaml but that didn't help me; the exception still occurs.
It should not be null. If it's null - you'll get the exception. This is why I asked if you use customized template (or a theme) for the Ribbon - if you don't have the Customization Dialog as a template part, it will be null and you'll get the exception.
As for the modifications you're doing in code behind - that shouldn't be an issue.
The Null Ref Exception thrown in the Loaded event of the QuickAccessToolbar suggests that either the QuickAccessToolbar is not attached to a parent XamRibbon control in the moment it's being loaded in the UI, or the CustomizationDialog property for this Ribbon is null.
Hi Georgi,
Thanks for spending time on my problem and your efforts.
Even I've tried to copy the given snippet in some sample application which does not give any exception. I've also set the customization dialog propety to null in xaml but that didn't help me; the exception still occurs.
But, as you have specified in 2nd case, our code is playing with QuickAccessToolbar and Ribbom objects in C# code.
e.g. 1. changing visibility of entire XamRibbon to false before user login, and making it visible if user logs in successfully;
2. changing ribbon's caption after login;
3. statements like : ribbon.QuickAccessToolbar.Tools.Clear(); OR ribbon.QuickAccessToolbar.Tools.Add(tool); where tool is QatPlaceholderTool object.
So, this way, we are modifying quick access toolbar dynamically in code behind. Do you think this is causing any problem? And yes, this is all being done in the same user control where Ribbon control is placed in.
I couldn't find anything wrong with your code that would cause the exception. I tried it locally with build 12.2.1001 and it works fine for me.
I couldn't find a tool with matching ID for one of the QatPlaceholderTools that you have in your QAT (the one with TargetId="Help"), but that shouldn't be an issue.
Looking at the exception, off the top of my head, here are the situations which could lead to it that I can think of:
1. If you're using customized template for the XamRibbon. Since 12.1 we added a Ribbon Customization feature, if you don't have a Customization Dialog in your template, then you might end-up facing such an exception. You can check if that's the issue by checking if ribbon.XamRibbonCustomizationDialog property is null.
2. If you're creating a QuickAccessToolbar object somewhere outside a XamRibbon control (e.g. in UserControl.Resources).
Could you check if that's the case?
Hope this helps,