Type 'RadToolBar' Was Not Found

5 posts, 0 answers
  1. KKalik
    KKalik avatar
    6 posts
    Member since:
    Jan 2012

    Posted 23 Feb 2012 Link to this post

    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.
  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 23 Feb 2012 Link to this post

    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 >>
  3. DevCraft banner
  4. KKalik
    KKalik avatar
    6 posts
    Member since:
    Jan 2012

    Posted 23 Feb 2012 Link to this post

    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.
  5. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 23 Feb 2012 Link to this post

    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 >>
  6. KKalik
    KKalik avatar
    6 posts
    Member since:
    Jan 2012

    Posted 23 Feb 2012 Link to this post

    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.
Back to Top
DevCraft banner