I Try to make a Quickaccestoolbar. I ahve the following code :
ButtonTool
btnToolCopy = new ButtonTool();
btnToolCopy.Id =
"copyTool";
// Adding ButtonTool to the QAT
qatToolCopy.TargetId =
// btnToolCopy.Id
qatToolCopy.TargetType =
QatPlaceholderToolType.Tool;
this.xamRibbon1.QuickAccessToolbar.Items.Add(qatToolCopy);
But i get a exception error :
An item with the specified TargetId 'copyTool' being added to the QuickAccessToolbar is not registered with the associated XamRibbon.
Thank you for help CaisseOdev
Hi Caisse,
The reason for the error is the ButtonTool must be added to the XamRibbon before it can be added to the QAT. To add the ButtonTool to the XamRibbon you'll need to add it to a XamRibbon group. This link demonstrates how you can do this: http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=xamRibbon_Add_Tools_to_a_Ribbon_Group.html
After the ButtonTool has been added to the group, you can add it to the QAT.http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=xamRibbon_Add_a_Tool_or_RibbonGroup_to_the_Quick_Access_Toolbar.html
Let me know if you have any questions on this.