Adding OutlookBar Item from XAML

4 posts, 0 answers
  1. HDD
    HDD avatar
    34 posts
    Member since:
    May 2010

    Posted 06 May 2010 Link to this post

    We have the latest Silverlight 4 version of the RAD Controls. 
    I am able to create the OutlookBarItems in code using this.outlookBar1.Items.Add(item),
    But when I try to do this in Blend XAML, I get this weird error message (at the bottom) after adding more than a couple of items.
    <telerikNavigation:RadOutlookBar x:Name="RadOutlookBar1" d:LayoutOverrides="HorizontalAlignment" Margin="0,72,0,0">
        <telerikNavigation:RadOutlookBarItem Header="Title 1">
           <Grid Background="Transparent" Height="220" VerticalAlignment="Top">
              <TextBlock Text="Title 1 Content"/>
        <telerikNavigation:RadOutlookBarItem Header="Title 2" IsSelected="True">
           <Grid Background="Transparent" Height="220" VerticalAlignment="Top">
              <TextBlock Text="Title 2 Content"/>
        <telerikNavigation:RadOutlookBarItem Header="Title 3">
           <Grid Background="Transparent" Height="220" VerticalAlignment="Top">
              <TextBlock Text="Title 3 Content"/>

    Error Message:
    An Exception was thrown.

    KeyNotFoundException: The given key was not present in the dictionary.

    at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
    at Telerik.Windows.Controls.OutlookBar.MinimizedOutlookBarItem.Telerik.Windows.Controls.OutlookBar.OutlookBarItem.set_Location(OutlookBarItemPosition value)
    at Telerik.Windows.Controls.OutlookBar.OutlookBarPanel.ArrangeOverride(Sixe finalSize)
    at System.Windows.FrameworkElement.ArrangeOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)

    InnerException: None

    FYI: I was not getting this error earlier when I was working with the trial version till two days back.

  2. robert hutchison
    robert hutchison avatar
    17 posts
    Member since:
    Feb 2010

    Posted 06 May 2010 Link to this post

    Well, here's a stranger thing, but it gets you to a place where you can set properties (until you do a build or one of many other actions).

    1. Select all of your RadOutlookBarItem XAML objects (not the outlook bar itself)
    2. cut them (to your clipboard)
    3. reload the designer - it will now load properly and the outlook bar will appear properly (empty, but you will see it)
    4. paste them back in - the RadOutlookBarItem objects will appear correctly inside your Outlook bar
    5. you will now be able to set properties on the RadOutlookBar and the RadOutlookBarItem objects.

    This will work in VS 2010 and in Blend 4. As soon as you do something like a build or test it, the designer will try to load it again and you will need to repeat this procedure.

    If someone has a way to actually fix this, please fill us in.

  3. HDD
    HDD avatar
    34 posts
    Member since:
    May 2010

    Posted 07 May 2010 Link to this post

    Thanks Rob,
    I guess that is what I have been doing till today.
    But the pain is, you have to do it each time when you compile.

    Here is another catch though. This error is not generated on compile if you have just two items (need to verify the number...)  in the Outlook Bar. That is what I have seen. Not really tested thoroughly though. But two items doesn't break the designer on compile.

    So do we have a fix for this?
    Thanks for responding Rob.

  4. Ivan
    Ivan avatar
    519 posts

    Posted 07 May 2010 Link to this post

    Hi Guys,

    Thank you for sharing the information.

    Indeed this is a known issue. You can track its progress in our online PITS system.

    Please vote in order to increase the priority of the issue.

    All the best,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top