none
Error when adding sample data to a combobox

    Question

  • Whenever I try to add sample data to a combobox, I get an error when I attempt to navigate to the screen while running the project.  Below is the combo box, and the error that gets generated when attempting to navigate to the screen:

    <Grid x:Name="LayoutRoot" Background="White">
      <TextBox Height="87" HorizontalAlignment="Right" Style="{StaticResource TextBox-Sketch}" VerticalAlignment="Top" Width="640" FontSize="48" IsReadOnly="True" Text="Banner" TextWrapping="Wrap"/>
      <TextBlock Height="28" HorizontalAlignment="Left" Margin="8,100,0,0" Style="{StaticResource TextBlock-Sketch}" VerticalAlignment="Top" Width="75" Text="Select City:" TextWrapping="Wrap"/>
      <ComboBox Style="{StaticResource ComboBox-Sketch}" VerticalAlignment="Top" Margin="83,99,272,0" FontSize="16">
       <i:Interaction.Triggers>
        <i:EventTrigger EventName="MouseLeftButtonDown">
         <pb:NavigateToScreenAction TargetScreen="Location_CentralScreens.Screen_1_2"/>
        </i:EventTrigger>
       </i:Interaction.Triggers>
       <ComboBoxItem>test</ComboBoxItem>
       <ComboBoxItem>test 2</ComboBoxItem>
      </ComboBox>
      <HyperlinkButton HorizontalAlignment="Left" Style="{StaticResource HyperlinkButton-Sketch}" VerticalAlignment="Top" Content="Home | " FontSize="16" Margin="11,62,0,0" Width="41"/>
      <HyperlinkButton HorizontalAlignment="Left" Margin="54,62,0,0" Style="{StaticResource HyperlinkButton-Sketch}" VerticalAlignment="Top" Width="126" FontSize="16" Content="Contact Information | "/>
      <HyperlinkButton HorizontalAlignment="Left" Margin="180,62,0,0" Style="{StaticResource HyperlinkButton-Sketch}" VerticalAlignment="Top" Width="126" FontSize="16" Content="Facility Information"/>
      <TextBox HorizontalAlignment="Right" Style="{StaticResource Note-Sketch}" Text="User will only see a list of cities to which they have access." TextWrapping="Wrap" d:LayoutOverrides="Width" Margin="0,142,50,158"/>
     </Grid>

    -----------------------------

    ERROR:

    -----------------------------

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.2; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; WWTClient2; Media Center PC 6.0; Zune 4.0; Tablet PC 2.0)
    Timestamp: Wed, 28 Apr 2010 16:23:28 UTC


    Message: Unhandled Error in Silverlight Application [Arg_TargetInvocationException]
    Arguments:
    Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=3.0.50106.0&File=mscorlib.dll&Key=Arg_TargetInvocationException   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
       at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
       at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
       at System.Activator.CreateInstance(Type type, Boolean nonPublic)
       at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       at System.Reflection.Assembly.CreateInstance(String typeName)
       at Microsoft.Expression.Prototyping.Workspace.PlayerWindow.InstantiateScreen(String screen, Boolean showImmediately)
       at Microsoft.Expression.Prototyping.Workspace.PlayerWindow.TransitionScreens(String from, String to)
       at Microsoft.Expression.Prototyping.Navigation.NavigationViewModel.NavigateToScreen(String name, Boolean record)
    Line: 1
    Char: 1
    Code: 0
    URI: http://localhost:3469/TestPage.html

    ----------------------------------------------------------------

    Anyone have an idea what I may be doing wrong?

    Wednesday, April 28, 2010 4:30 PM

Answers

  • Thanks for the project. :)  That makes it much easier to figure out what's going on. 

    Instead of

    <ComboBoxItem>test</ComboBoxItem>
    <ComboBoxItem>test 2</ComboBoxItem>

    Try

    <ComboBoxItem Content="test"/>
    <ComboBoxItem Content="test 2"/>

    If you'd like, instead of having to add ComboBoxItems yourself via the xaml editor, try right clicking on the combo box and selecting to insert one.  It should save you a little time.

    Hope that helps,
    Kelly

    Wednesday, April 28, 2010 7:23 PM

All replies

  • I don't see anything obviously wrong.  Would you be able to share the project?  If so, kellycan@microsoft.com
    Wednesday, April 28, 2010 5:43 PM
  • Thanks, Kelly. I just emailed you the zipped project. Please let me know if you do not receive it.

    Steve

    Wednesday, April 28, 2010 6:40 PM
  • Thanks for the project. :)  That makes it much easier to figure out what's going on. 

    Instead of

    <ComboBoxItem>test</ComboBoxItem>
    <ComboBoxItem>test 2</ComboBoxItem>

    Try

    <ComboBoxItem Content="test"/>
    <ComboBoxItem Content="test 2"/>

    If you'd like, instead of having to add ComboBoxItems yourself via the xaml editor, try right clicking on the combo box and selecting to insert one.  It should save you a little time.

    Hope that helps,
    Kelly

    Wednesday, April 28, 2010 7:23 PM