Error - value does not fall within the expected range

7 posts, 0 answers
  1. Lori
    Lori avatar
    3 posts
    Member since:
    Dec 2010

    Posted 17 Aug 2011 Link to this post

    Greetings,

    I've been trying to use the radtileview in my project but each time I click the maximize button on a tileitem, the "value does not fall within the expected range" error is thrown as an unhandled exception in App.

    In order to try to troubleshoot this, I was doing research and came across this thread: http://www.telerik.com/community/forums/silverlight/tileview/error-4004-unhandled-error-in-silverlight-application.aspx.  I downloaded the attached application and in fact, I still have the error except this time, I get it in the design view.  The error is pointing to these lines in MainPage.xaml:

                <Setter Property="MinimizedColumnWidth" Value="180" />
                <Setter Property="MinimizedRowHeight" Value="200" />
                <Setter Property="RowHeight" Value="200" />
                <Setter Property="ColumnWidth" Value="180" />

    On first loading the project, only the first line throw the error; however, I can comment out the line and the next line throws the error, and so on.

    It appears, though I can't yet prove it, I'm having some issue with width and height, even in my project.  But I don't really understand why this application doesn't just run as you suggest in the thread it should.

    The version of controls I'm using is : 2011.1.419.1040.  We haven't yet upgraded because we're at a critical testing point in our software and we just haven't had time to work through any upgrade issues. 

    Please advise,
    Thanks,
    Lori Tillery
    Fissure Corp.
  2. Markus
    Markus avatar
    7 posts
    Member since:
    Jun 2012

    Posted 20 Aug 2011 Link to this post

    Had the same problem, hence I did without setter properties and moved them to the tileview
    Instead of
     
    <Setter Property="MinimizedRowHeight" Value="200" />
    <Setter Property="MinimizedColumnWidth" Value="200" />
     
    I do use
     
    <telerik:RadTileView  ...
                                MinimizedColumnWidth="200"
                                MinimizedRowHeight="200" >
                  </telerik:RadTileView>

     

  3. DevCraft banner
  4. Lori
    Lori avatar
    3 posts
    Member since:
    Dec 2010

    Posted 20 Aug 2011 Link to this post

    Thanks for the reply Markus.  I ended up doing that as well and everything works.  I'm still very curious though as to what is different in my setup which prevents defining the styles in the usercontrol resources area.  It doesn't make sense.  I'm wondering if anyone from Telerik can comment.
  5. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 23 Aug 2011 Link to this post

    Hello Lori,
    Unfortunately without some more code snippets or a project that reproduces this issue it's going to be hard for us to find out what exactly is going wrong. For now the only thing I could think of is that there could be problems like the one that you've described if you're setting a theme to the RadTileView with the StyleManager.Theme attached property. That's because the Theme overrides the other RadTileView styles and the property setters are not applied.
    If you have more questions feel free to ask.

    Regards,
    Zarko
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  6. Markus
    Markus avatar
    7 posts
    Member since:
    Jun 2012

    Posted 23 Aug 2011 Link to this post

    MinimizedColumnWidth and MinimizedRowHeight are of type GridLength. Could it be that those types are not recognized in styles? Here is a code snippet that throws this error:

    <UserControl x:Class="LightSwitchApplication.IQTileView"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"           
        xmlns:IQ="clr-namespace:LightSwitchApplication"           
        mc:Ignorable="d"
        d:DesignHeight="300" d:DesignWidth="400" >
      
        <UserControl.Resources>
            <IQ:ByteArrayToImageConverter x:Key="ByteArrayToImageConverter" />
            <IQ:PositionConverter x:Key="PositionConverter" />
             
            <telerik:ContainerBindingCollection x:Key="ContainerBindings">
              <telerik:ContainerBinding PropertyName="Position"
                      Binding="{Binding Position, Mode=TwoWay, Converter={StaticResource PositionConverter}}" />
            </telerik:ContainerBindingCollection>
      
            <DataTemplate x:Key="headerTemplate" telerik:ContainerBinding.ContainerBindings="{StaticResource ContainerBindings}">
                <TextBlock Text="{Binding Description}" />
            </DataTemplate>
      
            <DataTemplate x:Key="contentTemplate">           
                <Image Source="{Binding Image, Converter={StaticResource ByteArrayToImageConverter}}"/>
            </DataTemplate>
      
            <Style TargetType="telerik:RadTileViewItem" x:Key="ItemStyle">
                <Setter Property="Margin" Value="1" />
                <Setter Property="Padding" Value="1" />
            </Style>
              
            <Style TargetType="telerik:RadTileView">                     
                <Setter Property="PreservePositionWhenMaximized" Value="True" />
                <Setter Property="TileStateChangeTrigger" Value="SingleClick" />
                <Setter Property="telerik:TileViewPanel.IsVirtualized" Value="True" />
                <Setter Property="IsAutoScrollingEnabled" Value="True" />
                <Setter Property="IsDockingEnabled" Value="False" />           
                <Setter Property="IsSelectionEnabled" Value="True" />
                <Setter Property="SelectionMode" Value="Single" />
                <Setter Property="ContentTemplate" Value="{StaticResource contentTemplate}"/>
                <Setter Property="ItemTemplate" Value="{StaticResource headerTemplate}"/>
                <Setter Property="MinimizedItemsPosition" Value="Right" />
                <!--had to comment the following-->
                <Setter Property="MinimizedRowHeight" Value="150" /> <!--value not in range-->
                <Setter Property="MinimizedColumnWidth" Value="150" />  <!--value not in range-->
                <!--<Setter Property="MaximizeMode" Value="One" />-->  <!--runtime exception-->
                <!--end comment-->
            </Style>
        </UserControl.Resources>
      
        <Grid x:Name="LayoutRoot" Background="Transparent" >     
            <telerik:RadTileView x:Name="IQradTileView"                          
                                ItemsSource="{Binding Screen.EstateImage}"
                                SelectedItem="{Binding Screen.EstateImage.SelectedItem, Mode=TwoWay}"
                                ItemContainerStyle="{StaticResource ItemStyle}"
                                MinimizedColumnWidth="150"
                                MinimizedRowHeight="150" >
            </telerik:RadTileView>
        </Grid>
    </UserControl>


    In the designer I do get the attached error: "Value does not fall within the expected range."

  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 26 Aug 2011 Link to this post

    Hi Markus,

    We managed to reproduce this issue in the RadTileView using this snippet. We logged it in our PITS(TileView: Design time error occurs when setting MinimizedRowHeight) where you are able to track its status. Thank you for your cooperation.

    Regards,
    Petar Mladenov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  8. Markus
    Markus avatar
    7 posts
    Member since:
    Jun 2012

    Posted 26 Aug 2011 Link to this post

    excellent and thx
Back to Top
DevCraft banner