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

Adding OutlookBar Item from XAML

3 Answers 47 Views
OutlookBar
This is a migrated thread and some comments may be shown as answers.
HDD
Top achievements
Rank 1
HDD asked on 06 May 2010, 08:57 PM
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"/>
       </Grid>
    </telerikNavigation:RadOutlookBarItem>
    <telerikNavigation:RadOutlookBarItem Header="Title 2" IsSelected="True">
       <Grid Background="Transparent" Height="220" VerticalAlignment="Top">
          <TextBlock Text="Title 2 Content"/>
       </Grid>
    </telerikNavigation:RadOutlookBarItem>
    <telerikNavigation:RadOutlookBarItem Header="Title 3">
       <Grid Background="Transparent" Height="220" VerticalAlignment="Top">
          <TextBlock Text="Title 3 Content"/>
       </Grid>
    </telerikNavigation:RadOutlookBarItem>
</telerikNavigation:RadOutlookBar>

Error Message:
An Exception was thrown.

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

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.

Thanks.

3 Answers, 1 is accepted

Sort by
0
robert hutchison
Top achievements
Rank 1
answered on 06 May 2010, 10:20 PM
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.

Thanks,
Rob
0
HDD
Top achievements
Rank 1
answered on 07 May 2010, 02:18 PM
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.

0
Ivan
Telerik team
answered on 07 May 2010, 05:14 PM
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,
Ivan
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.
Tags
OutlookBar
Asked by
HDD
Top achievements
Rank 1
Answers by
robert hutchison
Top achievements
Rank 1
HDD
Top achievements
Rank 1
Ivan
Telerik team
Share this question
or