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

I am getting that value does not fall into range exception

1 Answer 33 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Syed Asif
Top achievements
Rank 1
Syed Asif asked on 30 May 2013, 10:08 AM

I am getting that value does not fall into range exception

This is the code I am using

But same code is working in Silverlight4 but it not working silverlight5

 

<tileview:TileToFluideStateConverter x:Key="tileConverter" />

        <DataTemplate x:Key="ItemTemplate">

            <TextBlock Text="{Binding HeaderText}" />

        </DataTemplate>

        <DataTemplate x:Key="ContentTemplate">

            <telerik:RadFluidContentControl ContentChangeMode="Manual" TransitionDuration="0:0:.5"                    

                                  State="{Binding State, Converter={StaticResource tileConverter}}">

                <telerik:RadFluidContentControl.SmallContent>

                    <telerik:RadBusyIndicator IsBusy="{Binding Path=IsBusy}">

                        <ContentControl Content="{Binding Path=SmallContent}"/>

                    </telerik:RadBusyIndicator>

                </telerik:RadFluidContentControl.SmallContent>

                <telerik:RadFluidContentControl.Content>

                    <telerik:RadBusyIndicator IsBusy="{Binding Path=IsBusy}">

                        <ContentControl Content="{Binding Path=NormalContent}"/>

                    </telerik:RadBusyIndicator>

                </telerik:RadFluidContentControl.Content>

                <telerik:RadFluidContentControl.LargeContent>

                    <telerik:RadBusyIndicator IsBusy="{Binding Path=IsBusy}">

                        <ContentControl Content="{Binding Path=LargeContent}"/>

                    </telerik:RadBusyIndicator>

                </telerik:RadFluidContentControl.LargeContent>

            </telerik:RadFluidContentControl>

        </DataTemplate>

    </base:PhoenixBaseRibbonView.Resources>

    <Grid>

        <!--<ScrollViewer  HorizontalScrollBarVisibility="Auto"  VerticalAlignment="Stretch" HorizontalAlignment="Stretch" VerticalScrollBarVisibility="Auto" Padding="0" BorderThickness="0">-->

        <telerik:RadTileView x:Name="tileView" 

                                 VerticalAlignment="Stretch" HorizontalAlignment="Stretch"

                                 PreservePositionWhenMaximized="True" telerik:TileViewPanel.IsVirtualized="True"

                                 IsAutoScrollingEnabled="True" TileStateChangeTrigger="SingleClick"

                                 ColumnsCount="2"

                                ItemTemplate="{StaticResource ItemTemplate}" ContentTemplate="{StaticResource ContentTemplate}" ItemsSource="{Binding Path=RichParts}"

                                 MaximizeMode="One">

        </telerik:RadTileView>

        <!--</ScrollViewer>-->

    </Grid>

  void tileView_TileStateChanged(object sender, Telerik.Windows.RadRoutedEventArgs e)

        {

            RadTileViewItem item = e.OriginalSource as RadTileViewItem;

            if (item != null)

            {

                var viewmodel = ((RadFluidContentControl)item.Content).DataContext as IPhoenixBaseRichletView;

                if (viewmodel != null)

                {

                    viewmodel.State = item.TileState;

                }

            }

        }

        void RichPartList_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)

        {

            if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)

            {

                try

                {

                    foreach (PhoenixBaseRichletView richlet in e.NewItems)

                    {

                        RadTileViewItem item = new RadTileViewItem();

                        item.Header = richlet.HeaderText;

                        var contentTemplate = this.Resources["ContentTemplate"] as DataTemplate;

                        var ctrl = contentTemplate.LoadContent() as RadFluidContentControl;

                        ctrl.DataContext = richlet;

                        item.Content = ctrl;

                        this.tileView.Items.Add(item);

                    }

                }

                catch (Exception ex)

                {

                    this.Error = ex;

                }

            }

        }

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 03 Jun 2013, 12:32 PM
Hi Syed,

I am not sure that I understand your scenario. Also, I am confused because this thread regards the RadTreeView control for Silverlight. Can you please confirm that your question regards the RadTileView control so I can change the product of your post.

If you try to configure our RadTileView control I will kindly ask you to elaborate more on your scenario and how you reproduce the behavior that you report. It will be best if you can isolate the issue and send us a sample project where the behavior can be reproduced on our side. By doing so we will be able to further investigate and suggest the best approach in your scenario.

On the other hand, please note that we no longer support Silverlight 4 and we strongly recommend to our clients to upgrade to our latest official release. By using our latest you will be able to get advantage of the latest fixes and newest features or our controls.

Regards,
Pavel R. Pavlov
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
TreeView
Asked by
Syed Asif
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or