locked
Value does not fall within the expected range RRS feed

  • Question

  • Here's my xaml :

    <UserControl
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     mc:Ignorable="d"
     xmlns:DevExpress_AgDataGrid="clr-namespace:DevExpress.AgDataGrid;assembly=DevExpress.AgDataGrid.v8.2"
     xmlns:local="clr-namespace:GuerlainLibrary"
     x:Class="GuerlainLibrary.Guerlain_Form_QuickSaleInv"
     Height="690" HorizontalAlignment="Left" VerticalAlignment="Top" Width="778">

     <Grid x:Name="LayoutRoot">
      <Canvas>
       <Image x:Name="imgSearchIcon" Height="44" Width="47" Canvas.Left="9" Canvas.Top="8"/>
       <TextBlock Height="24" HorizontalAlignment="Left" Tag="Scan or search product;Balayage ou recherche de produit" VerticalAlignment="Top" Width="351" Canvas.Left="60" FontSize="16" Foreground="Black" Text="Scan or search product" TextWrapping="Wrap"/>
       <TextBox x:Name="txtSearchProduct" FontFamily="Arial" FontSize="16" Foreground="Black" TabIndex="0" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" Width="279" Canvas.Left="60" Canvas.Top="24" TextWrapping="Wrap" KeyDown="txtSearchProduct_KeyDown"/>
       <Button x:Name="btGoSearchProduct" FontSize="16" FontWeight="Bold" Foreground="Black" Cursor="Hand" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" Width="37" Content="GO" Canvas.Left="343" Canvas.Top="24" Click="btGoSearchProduct_Click"/>
       <ScrollViewer x:Name="svProductList" BorderBrush="#FF00A4FF" Height="296" HorizontalAlignment="Left" VerticalAlignment="Top" Width="762" Canvas.Left="9" Canvas.Top="207" VerticalScrollBarVisibility="Auto">
        <StackPanel x:Name="spProductList"/>
       </ScrollViewer>
       <DevExpress_AgDataGrid:AgDataGrid x:Name="agProductsList" Height="112" Width="762" Canvas.Left="8" Canvas.Top="67" AllowEditing="False" AllowDeleting="False" AllowColumnResizing="True" AllowColumnMoving="False" AllowColumnGrouping="False"/>
       <TextBlock x:Name="lblItemsCount" Height="21" Width="177" Canvas.Left="593" Canvas.Top="42" TextAlignment="Right" FontSize="13.333" Foreground="Black"/>
       <Border Height="160" Width="344" Canvas.Left="426" Canvas.Top="507" BorderBrush="Black" BorderThickness="1" CornerRadius="12">
        <Grid Margin="7">
         <TextBlock Height="18" HorizontalAlignment="Left" Tag="Sub total;Sous total" VerticalAlignment="Top" Width="231" FontSize="14.667" Foreground="Black" Text="Sub total" TextWrapping="Wrap" Margin="8,8,0,0" d:LayoutOverrides="VerticalAlignment" FontFamily="Arial"/>
         <TextBlock Height="18" HorizontalAlignment="Left" Tag="TOTAL TO CASH;TOTAL À ENCAISSER" VerticalAlignment="Top" Width="231" FontSize="14.667" Foreground="Black" Text="TOTAL TO CASH" TextWrapping="Wrap" Margin="8,118,0,0" FontFamily="Arial" FontWeight="Bold"/>
         <TextBlock x:Name="lbTaxe1" Height="18" HorizontalAlignment="Left" Tag="Sub total;Sous total" VerticalAlignment="Top" Width="231" FontSize="14.667" Foreground="Black" Text="lbTaxe1" TextWrapping="Wrap" Margin="8,30,0,0" FontFamily="Arial" d:LayoutOverrides="VerticalAlignment"/>
         <TextBlock x:Name="lbTaxe2" Height="18" HorizontalAlignment="Left" Tag="Sub total;Sous total" VerticalAlignment="Top" Width="231" FontSize="14.667" Foreground="Black" Text="lbTaxe2" TextWrapping="Wrap" Margin="8,52,0,0" FontFamily="Arial" d:LayoutOverrides="VerticalAlignment"/>
         <TextBlock x:Name="lbTaxe3" Height="18" HorizontalAlignment="Left" Tag="Sub total;Sous total" VerticalAlignment="Top" Width="231" FontSize="14.667" Foreground="Black" Text="lbTaxe3" TextWrapping="Wrap" Margin="8,74,0,0" FontFamily="Arial"/>
         <TextBlock x:Name="lbRate1" Height="18" HorizontalAlignment="Left" Tag="Sub total;Sous total" VerticalAlignment="Top" Width="77" FontSize="14.667" Foreground="Black" Text="lbRate1" TextWrapping="Wrap" Margin="243,30,0,0" FontFamily="Arial" d:LayoutOverrides="VerticalAlignment"/>
         <TextBlock x:Name="lbRate2" Height="18" HorizontalAlignment="Left" Tag="Sub total;Sous total" VerticalAlignment="Top" Width="77" FontSize="14.667" Foreground="Black" Text="lbRate2" TextWrapping="Wrap" Margin="243,52,0,0" FontFamily="Arial" d:LayoutOverrides="VerticalAlignment"/>
         <TextBlock x:Name="lbRate3" Height="18" HorizontalAlignment="Left" Tag="Sub total;Sous total" VerticalAlignment="Top" Width="77" FontSize="14.667" Foreground="Black" Text="lbRate3" TextWrapping="Wrap" Margin="243,74,0,0" FontFamily="Arial"/>
         <TextBlock x:Name="lbTotal" Height="18" HorizontalAlignment="Left" Tag="Sub total;Sous total" VerticalAlignment="Top" Width="77" FontSize="14.667" Foreground="Black" Text="lbTotal" TextWrapping="Wrap" Margin="243,118,0,0" FontFamily="Arial"/>
         <TextBlock x:Name="lbSubTotal" Height="18" HorizontalAlignment="Left" Tag="Sub total;Sous total" VerticalAlignment="Top" Width="77" FontSize="14.667" Foreground="Black" Text="lbSubTotal" TextWrapping="Wrap" Margin="243,8,0,0" FontFamily="Arial" d:LayoutOverrides="VerticalAlignment"/>
        </Grid>
       </Border>
      </Canvas>
      <local:Guerlain_ProductListTitle Foreground="Black" HorizontalAlignment="Left" Margin="16,189,0,0" Width="754" d:LayoutOverrides="Height"/>
     </Grid>
    </UserControl>

    There's nothing wrong there,  I didn't change a single caracter and 1 minute later this xaml is useless and giving the error mentioned in the subject.
    What's going on ?  It says the error is at line 1, position 1 and the UserControl is underscored... How am I supose to know where is the problem ?

    Tuesday, October 6, 2009 4:18 PM

Answers

  • I don't have this problem anymore.  Probably due to the fact that I did delete all the OBJ and BIN directory of all the projects in the solution and do a clean REBUILD
    Hope this will help others....
    • Marked as answer by GearWorld Friday, November 13, 2009 11:05 AM
    Friday, November 13, 2009 11:05 AM

All replies

  • Is the error associated with the .cs code behind file? I see that you have some click events assigned and I can't get past those errors in order to see the one you are talking about.
    • Proposed as answer by RockwellDesign77 Tuesday, October 6, 2009 4:26 PM
    • Unproposed as answer by GearWorld Wednesday, October 7, 2009 12:10 PM
    Tuesday, October 6, 2009 4:26 PM
  • Is the error associated with the .cs code behind file? I see that you have some click events assigned and I can't get past those errors in order to see the one you are talking about.

    No it's the line : <DevExpress_AgDataGrid:AgDataGrid x:Name="agProductsList" Height="112" Width="762" Canvas.Left="8" Canvas.Top="67" AllowEditing="False" AllowDeleting="False" AllowColumnResizing="True" AllowColumnMoving="False" AllowColumnGrouping="False"/>

    That seems to be the problem.  I'm investigating with the third party DevExpress.  What is very weird is that this DataGrid is in my page since almost
    4 months and I didnt't change a bit on that page nor I did change the refenrece or the installation of DevExpress grid and
    it's only in Blend 3 that I have sudently a problem of that kind.  VS 2008 compile very nicely and the project runs very normaly

    Just Blend 3 reporting this Value does not fall..... and it is reporting it as to be on the first line but I presunme it's not aware of the real problem which might be the DataGrid but again this DataGrid never changed on that page and nothing related to it have been touched since 4 months

    So of course I'm unable to design again on each page that have this Grid because the Viewer doesn't show anything until I fix the problem which I really don't know what it is.

    I did start a new project to reproduce the problem and YES as soon as I put th grid on the design view, it pops the error Value does not fall within the expected range
    Tuesday, October 6, 2009 5:35 PM
  • Did we have an update that this Grid is unprepared for ?

    Tuesday, October 6, 2009 6:05 PM
  • Don't ask me why but I did remove the reference to the faulty line and then re-reference it and the problem is solved.  Why is that ? A mystery that will stay forever in the past.
    Tuesday, October 6, 2009 10:59 PM
  • Don't ask me why but I did remove the reference to the faulty line and then re-reference it and the problem is solved.  Why is that ? A mystery that will stay forever in the past.

    I was WRONG.  I also did remove a ResourceDictionary I had and since I re-add the ResourceDictionary, the problem is back
    so it seems that adding a ResourceDictionary cause this error.

    Now I'm lost and I don't know what to do with this since I need the DataGrid and I also need a ResourceDictionay since adding a Style to the Application level needs a ResourceDictinay and a Linked to it to make my UserControl discovering the Style at the Application level

    Any toughts ?
    Wednesday, October 7, 2009 12:12 PM
  • I don't have this problem anymore.  Probably due to the fact that I did delete all the OBJ and BIN directory of all the projects in the solution and do a clean REBUILD
    Hope this will help others....
    • Marked as answer by GearWorld Friday, November 13, 2009 11:05 AM
    Friday, November 13, 2009 11:05 AM
  • I got the same issue, as the work-around, you can clean and rebuild.
    Thursday, May 20, 2010 5:10 AM
  • I'm happy to say that I don't use DevExpress anymore.  I bought Telerik.  A very great product,  The support is great and the GridView is awesome.
    Now with Silverlight 4,  Everything works so well.

    Happy Silverlighting !

     

    Saturday, May 22, 2010 10:39 AM