This is a migrated thread and some comments may be shown as answers.

Type 'RadToolBar' Was Not Found

4 Answers 173 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
KKalik
Top achievements
Rank 1
KKalik asked on 23 Feb 2012, 02:23 PM
I'm creating a RadToolBar user control. When I run the control in my application I get the below error.

Error:
{System.Windows.Markup.XamlParseException: The type 'RadToolBarTray' was not found. [Line: 8 Position: 63] ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at System.Windows.ResourceManagerWrapper.GetResourceForUri(Uri xamlUri, Type componentType)
   --- End of inner exception stack trace ---
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at Application.Presentation.Controls.DataSetToolBarCtrl.InitializeComponent()
   at Application.Presentation.Controls.DataSetToolBarCtrl..ctor()}

My simple RadToolBar Xaml:
        xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
         x:Class="Application.Presentation.Controls.DataSetToolBarCtrl"
        HorizontalAlignment="Center" VerticalAlignment="Center">
  
    <telerik:RadToolBarTray VerticalAlignment="Center" Margin="10,0,0,0">
        <telerik:RadToolBar>
            <Button Tag="Print" x:Name="btnPrintGrid" ToolTipService.ToolTip="Print Grid">
                <Image Width="16" Height="16" Source="/Application.Client;component/Images/print.png" />
            </Button>
            <Button Tag="Excel" x:Name="btnExportGrid" ToolTipService.ToolTip="Export Grid to Excel">
                <Image Width="16" Height="16" Source="/Application.Client;component/Images/excel.png" />
            </Button>
        </telerik:RadToolBar>
    </telerik:RadToolBarTray>
</UserControl>


Telerik Build:
(v.2011.3.1220.1040 Trial)

Thank you for your help.

4 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 23 Feb 2012, 02:50 PM
Hi Katelin,

We are not aware of such an existing issue. Could you please take a look at the attached project and let me know if I am missing anything. I'd be glad to further assist you. 

All the best,
Kiril Stanoev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
KKalik
Top achievements
Rank 1
answered on 23 Feb 2012, 03:47 PM
Hi Kiril,

I plugged in your solution and it did not solve the issue. I did notice that the RadToolBar is missing from my VS Toolbox. I have attached a photo of what I'm seeing.
0
Kiril Stanoev
Telerik team
answered on 23 Feb 2012, 04:17 PM
Hi Katelin,

We are already aware of the issue where RadToolBar does not appear in the VS toolbox. Unfortunately we are not aware of an existing workaround. We will contact you as soon as we manage to fix the issue. Thank you for the cooperation and understanding.

Kind regards,
Kiril Stanoev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
KKalik
Top achievements
Rank 1
answered on 23 Feb 2012, 04:50 PM
Eureka!!

This turned out to not be a specific Telerik control issue, but an integration of controls into LightSwitch issue. The examples provided for the control do not include the "x:Name" property for the RadToolBar or RadToolBarTray which are required to load controls into a LightSwitch application. I have attached the modified code below:

<UserControl x:Class="Application.Presentation.Controls.TEST"
        xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
        HorizontalAlignment="Center" VerticalAlignment="Center">
    <telerik:RadToolBarTray x:Name="myToolBarTray" VerticalAlignment="Center" Margin="10,0,0,0">
        <telerik:RadToolBar x:Name="myToolBar">
            <Button Tag="Print" x:Name="btnPrintGrid" ToolTipService.ToolTip="Print">
                <Image Width="16" Height="16" Source="/Application.Client;component/Images/print.png" />
            </Button>
            <Button Tag="Excel" x:Name="btnExportGrid" ToolTipService.ToolTip="Export to Excel">
                <Image Width="16" Height="16" Source="/Application.Client;component/Images/excel.png" />
            </Button>
        </telerik:RadToolBar>
    </telerik:RadToolBarTray>
</UserControl>

Thank you for your help Kiril.
Tags
ToolBar
Asked by
KKalik
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
KKalik
Top achievements
Rank 1
Share this question
or