Telerik Forums
UI for WPF Forum
3 answers
268 views
hello dear telerik team

ive been working with your library for a couple of days the main reason my attention was drawn twards this product was its beautifull tileview but yesterday when i was testing it i ran into an error i couldnt find out the reason of.

well the situation is i have a tile view with a certain number of tiles explicitly named and defined in xaml.all tiles have rad fluid control in them for different states. and i have a number of buttons outside this tile view (two button for each tile). one of these buttons hides the tile if it is shown and the other either shows and mazimizes the tile if its hidden or maximizes it if it is shown but minimized .
well everything is nearly so simple but after i play around with a little showing-hiding-maximising tiles suddenly it jumps out with this error:

Message: Index was outside the bounds of the array.
Source: Telerik.Windows.Controls.Navigation
Stacktrace:    at Telerik.Windows.Controls.TileViewPanel.UpdatePositionRectangle(Int32 position, Rect itemPlacement) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TileView\TileViewPanel.cs:line 1251
   at Telerik.Windows.Controls.TileViewPanel.MeasureARow(Int32 startCol, Int32 row, Boolean isVirtualized, Double& minTop, Double& minHeight) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TileView\TileViewPanel.cs:line 1144
   at Telerik.Windows.Controls.TileViewPanel.MeasureRestoredChildren(Boolean isVirtualized, Int32 startRow) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TileView\TileViewPanel.cs:line 1039
   at Telerik.Windows.Controls.TileViewPanel.MeasureItems() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TileView\TileViewPanel.cs:line 962
   at Telerik.Windows.Controls.TileViewPanel.MeasureOverride(Size availableSize) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TileView\TileViewPanel.cs:line 397
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at TileHiddenProblem.App.Main() in C:\Users\Moosavi\Desktop\TileHiddenProblem\TileHiddenProblem\obj\x86\Debug\App.g.cs:line 0
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

thank you very much in advance for solving my problem

the codes:

mainwindow.xaml:

<Window x:Class="TileHiddenProblem.MainWindow"
  
  
  
xmlns:common="clr-namespace:TileHiddenProblem"
  
Title="MainWindow" Height="350" Width="525">
  
<Grid>
  
<Grid.ColumnDefinitions>
  
<ColumnDefinition Width="50"/>
  
<ColumnDefinition Width="50"/>
  
<ColumnDefinition Width="*"/>
  
</Grid.ColumnDefinitions>
  
<Grid Grid.Column="0">
  
<StackPanel>
  
<Button Width="50" Content="CallTile" Click="Button_Click_1"/>
  
<Button Width="50" Content="MessageTile" Click="Button_Click_1"/>
  
<Button Width="50" Content="CommandTile" Click="Button_Click_1"/>
  
<Button Content="ITServicesTile" Click="Button_Click_1"/>
  
<Button Content="SubscribersTile" Click="Button_Click_1"/>
  
<Button Content="GroupTile" Click="Button_Click_1"/>
  
<Button Content="ChangeTrackerTile" Click="Button_Click_1"/>
  
<Button Content="RecentCallsTile" Click="Button_Click_1"/>
  
</StackPanel>
  
</Grid>
  
<Grid Grid.Column="1">
  
<StackPanel>
  
<Button Width="50" Content="CallTile" Click="Button_Click_2"/>
  
<Button Width="50" Content="MessageTile" Click="Button_Click_2"/>
  
<Button Width="50" Content="CommandTile" Click="Button_Click_2"/>
  
<Button Content="ITServicesTile" Click="Button_Click_2"/>
  
<Button Content="SubscribersTile" Click="Button_Click_2"/>
  
<Button Content="GroupTile" Click="Button_Click_2"/>
  
<Button Content="ChangeTrackerTile" Click="Button_Click_2"/>
  
<Button Content="RecentCallsTile" Click="Button_Click_2"/>
  
</StackPanel>
  
</Grid>
  
<common:radTileControl x:Name="tc01" Grid.Column="2"/>
  
</Grid>
  
</Window>

MainWindow.xaml.cs :

using System;
  
using System.Collections.Generic;
  
using System.Linq;
  
using System.Text;
  
using System.Windows;
  
using System.Windows.Controls;
  
using System.Windows.Data;
  
using System.Windows.Documents;
  
using System.Windows.Input;
  
using System.Windows.Media;
  
using System.Windows.Media.Imaging;
  
using System.Windows.Navigation;
  
using System.Windows.Shapes;
  
using Telerik.Windows.Controls;
  
namespace TileHiddenProblem
  
{
  
/// <summary>
  
/// Interaction logic for MainWindow.xaml
  
/// </summary>
  
public partial class MainWindow : Window
  
{
  
public MainWindow()
  
{
  
InitializeComponent();
  
}
  
private void Button_Click_1(object sender, RoutedEventArgs e)
  
{
  
Button bt = e.OriginalSource as Button;
  
tc01.ChangeTileState(bt.Content.ToString());
  
}
  
private void Button_Click_2(object sender, RoutedEventArgs e)
  
{
  
Button bt = e.OriginalSource as Button;
  
tc01.ChangeTileStateHidden(bt.Content.ToString());
  
}
  
  
}
  
}


radtilecontrol.xaml :
<UserControl x:Class="TileHiddenProblem.radTileControl"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
             xmlns:Telerik_Windows_Controls_TileView="clr-namespace:Telerik.Windows.Controls.TileView;assembly=Telerik.Windows.Controls.Navigation,Version=2011.2.0920.40,Culture=neutral,PublicKeyToken=5803cfa389c90ce7"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <telerikNavigation:RadTileView TileStateChangeTrigger="SingleClick" MinimizedItemsPosition="Bottom" VerticalAlignment="Stretch"  HorizontalAlignment="Stretch" Name="tvc_MainTiles" TileStateChanged="tvc_MainTiles_TilesStateChanged" Loaded="tvc_MainTiles_Loaded" 
                           MinimizedRowHeight="45" MinimizedColumnWidth="200" IsItemDraggingEnabled="True" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"  DragMode="Swap" IsAnimationOptimized="True" IsTextSearchEnabled="False" PreservePositionWhenMaximized="False" FontFamily="B Titr" FontSize="14">
  
  
  
        <telerikNavigation:RadTileView.Resources>
  
              
  
            <Style x:Key="DragableTileStyle"  TargetType="{x:Type telerikNavigation:RadTileViewItem}">
                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                <Setter Property="Background" Value="#CC000000"/>
                <Setter Property="BorderBrush" Value="{StaticResource RadTileView_Border}"/>
                <Setter Property="BorderThickness" Value="1"/>
                <!--<Setter Property="FlowDirection" Value="RightToLeft"/>-->
                <Setter Property="Padding" Value="7"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="telerikNavigation:RadTileViewItem">
                            <Grid x:Name="Maingrid">
                                <Border Margin="{TemplateBinding Padding}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="5">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="*"/>
                                        </Grid.RowDefinitions>
                                        <ContentPresenter Cursor="Arrow" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Row="1" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                        <!--<Border Cursor="Hand" Background="{StaticResource RadTileView_HeaderBackground}" BorderBrush="{StaticResource RadTileView_HeaderBorder}" BorderThickness="0 0 0 1" CornerRadius="4 4 0 0" Padding="10 0 7 0">-->
                                        <Border Cursor="Hand" Background="{StaticResource TileView_HeaderBackground}" BorderBrush="{StaticResource RadTileView_HeaderBorder}" BorderThickness="0 0 0 1" >
                                            <Grid MinHeight="28"  >
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="*"/>
                                                    <!--<ColumnDefinition Width="15"/>
                                                    <ColumnDefinition Width="20"/>
                                                    <ColumnDefinition Width="20"/>-->
  
                                                </Grid.ColumnDefinitions>
                                                <Border  Grid.Column="0"  x:Name="GripBarElement" >
                                                    <!--<ContentPresenter Height="15" HorizontalAlignment="Stretch" Margin="10,0,10,0" VerticalAlignment="Stretch" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}"/>-->
                                                    <Telerik_Windows_Controls_TileView:TileViewItemHeader x:Name="HeaderPart" 
                                                                 HeaderTemplate="{TemplateBinding HeaderTemplate}"
                                                                 Style="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=HeaderStyle, Mode=TwoWay}">
                                                        <ContentPresenter Height="15" HorizontalAlignment="Stretch" Margin="10,0,10,0" VerticalAlignment="Stretch" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}"/>
                                                    </Telerik_Windows_Controls_TileView:TileViewItemHeader>
  
                                                </Border>
  
                                            </Grid>
                                        </Border>
                                        <Rectangle x:Name="DisabledVisual" Fill="{StaticResource DisabledBrush}" RadiusX="4" RadiusY="4" Visibility="Collapsed" Grid.RowSpan="2"/>
                                    </Grid>
                                </Border>
                                <!-- Selectrion state -->
                                <Grid x:Name="SelectedItem" Visibility="Collapsed" Margin="-1">
                                    <Border  CornerRadius="{StaticResource TileView_OuterBorder_CornerRadius}"
                                Margin="{TemplateBinding Padding}" BorderBrush="{StaticResource ControlOuterBorder_Selected}" BorderThickness="2" />
                                </Grid>
                                <!-- MouseOver dragging state -->
                                <Border x:Name="MouseOverBorder"
                                Visibility="Collapsed"
                                Opacity="0.5"
                                BorderThickness="{StaticResource TileView_MaximizeArea_BorderThickness}"
                                BorderBrush="{StaticResource TileView_MaximizeArea_BorderBrush}"
                                Background="{StaticResource TileView_MaximizeArea_Background}" />
  
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter TargetName="SelectedItem" Property="Visibility" Value="Visible" />
                                    <Setter Property="Visibility" Value="Collapsed" TargetName="Maingrid"/>
                                </Trigger>
                                <Trigger Property="IsMouseOverDragging"
                                 Value="True">
                                    <Setter TargetName="MouseOverBorder" Property="Visibility" Value="Visible"></Setter>
  
                                </Trigger>
                            </ControlTemplate.Triggers>
  
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
  
            <DataTemplate x:Key="TileTemplate">
                <Ellipse Height="40" Width="40"/>
            </DataTemplate>
  
  
            <Style TargetType="telerik:RadTileViewItem">
                <Setter Property="Background" Value="#CC000000" />
            </Style>
  
            <Style x:Key="FluidContentControlStyle" TargetType="telerik:RadFluidContentControl" >
                <Setter Property="ContentChangeMode" Value="Manual" />
            </Style>
  
        </telerikNavigation:RadTileView.Resources>
  
  
        <telerikNavigation:RadTileViewItem x:Name="CallTile" Header="calltile"  ForceCursor="True" Background="#CC000000">
            <telerik:RadFluidContentControl Style="{StaticResource ResourceKey=FluidContentControlStyle}" >
  
                <telerik:RadFluidContentControl.SmallContent>
                    <Grid>
                    </Grid>
                </telerik:RadFluidContentControl.SmallContent>
  
                <telerik:RadFluidContentControl.Content>
                    <Grid >
                    </Grid>
                </telerik:RadFluidContentControl.Content>
  
                <telerik:RadFluidContentControl.LargeContent>
  
                    <Grid>
                    </Grid>
                </telerik:RadFluidContentControl.LargeContent>
  
            </telerik:RadFluidContentControl>
        </telerikNavigation:RadTileViewItem>
  
        <telerikNavigation:RadTileViewItem x:Name="MessageTile"  Header="message tile" >
            <telerik:RadFluidContentControl Style="{StaticResource ResourceKey=FluidContentControlStyle}">
  
                <telerik:RadFluidContentControl.SmallContent>
                    <Grid>
                    </Grid>
                </telerik:RadFluidContentControl.SmallContent>
  
                <telerik:RadFluidContentControl.Content>
                    <Grid>
  
                    </Grid>
                </telerik:RadFluidContentControl.Content>
  
                <telerik:RadFluidContentControl.LargeContent>
                    <Grid>
                    </Grid>
                </telerik:RadFluidContentControl.LargeContent>
  
            </telerik:RadFluidContentControl>
        </telerikNavigation:RadTileViewItem>
  
        <telerikNavigation:RadTileViewItem x:Name="CommandTile"  Header="commandtile">
            <telerik:RadFluidContentControl Style="{StaticResource ResourceKey=FluidContentControlStyle}">
  
                <telerik:RadFluidContentControl.SmallContent>
                    <Grid>
  
                    </Grid>
                </telerik:RadFluidContentControl.SmallContent>
  
                <telerik:RadFluidContentControl.Content>
                    <Grid >
                    </Grid>
                </telerik:RadFluidContentControl.Content>
  
                <telerik:RadFluidContentControl.LargeContent>
                    <Grid>
                    </Grid>
                </telerik:RadFluidContentControl.LargeContent>
  
            </telerik:RadFluidContentControl>
        </telerikNavigation:RadTileViewItem>
  
        <telerikNavigation:RadTileViewItem x:Name="ITServicesTile"  Header="itservices">
            <telerik:RadFluidContentControl Style="{StaticResource ResourceKey=FluidContentControlStyle}">
  
                <telerik:RadFluidContentControl.SmallContent>
                    <Grid>
  
                    </Grid>
                </telerik:RadFluidContentControl.SmallContent>
  
                <telerik:RadFluidContentControl.Content>
                    <Grid >
                    </Grid>
                </telerik:RadFluidContentControl.Content>
  
                <telerik:RadFluidContentControl.LargeContent>
                    <Grid>
                    </Grid>
                </telerik:RadFluidContentControl.LargeContent>
  
            </telerik:RadFluidContentControl>
        </telerikNavigation:RadTileViewItem>
  
        <telerikNavigation:RadTileViewItem x:Name="SubscribersTile"  Header="subscribertile">
            <telerik:RadFluidContentControl Style="{StaticResource ResourceKey=FluidContentControlStyle}">
  
                <telerik:RadFluidContentControl.SmallContent>
                    <Grid>
  
                    </Grid>
                </telerik:RadFluidContentControl.SmallContent>
  
                <telerik:RadFluidContentControl.Content>
                    <Grid>
  
                    </Grid>
                </telerik:RadFluidContentControl.Content>
  
                <telerik:RadFluidContentControl.LargeContent>
                    <Grid>
                    </Grid>
                </telerik:RadFluidContentControl.LargeContent>
  
            </telerik:RadFluidContentControl>
        </telerikNavigation:RadTileViewItem>
  
        <telerikNavigation:RadTileViewItem x:Name="GroupTile"  Header="grouptile">
            <telerik:RadFluidContentControl Style="{StaticResource ResourceKey=FluidContentControlStyle}">
  
                <telerik:RadFluidContentControl.SmallContent>
                    <Grid>
                    </Grid>
                </telerik:RadFluidContentControl.SmallContent>
  
                <telerik:RadFluidContentControl.Content>
                    <Grid >
                    </Grid>
                </telerik:RadFluidContentControl.Content>
  
                <telerik:RadFluidContentControl.LargeContent>
                    <Grid>
                    </Grid>
                </telerik:RadFluidContentControl.LargeContent>
  
            </telerik:RadFluidContentControl>
        </telerikNavigation:RadTileViewItem>
        <telerikNavigation:RadTileViewItem x:Name="ChangeTrackerTile"  Header="changetrackertile">
            <telerik:RadFluidContentControl Style="{StaticResource ResourceKey=FluidContentControlStyle}">
  
                <telerik:RadFluidContentControl.SmallContent>
                    <Grid>
                    </Grid>
                </telerik:RadFluidContentControl.SmallContent>
  
                <telerik:RadFluidContentControl.Content>
                    <Grid></Grid>
                </telerik:RadFluidContentControl.Content>
  
                <telerik:RadFluidContentControl.LargeContent>
                    <Grid>
                          
                    </Grid>
                </telerik:RadFluidContentControl.LargeContent>
  
            </telerik:RadFluidContentControl>
        </telerikNavigation:RadTileViewItem>
        <telerikNavigation:RadTileViewItem x:Name="RecentCallsTile"  Header="recentcalltile">
            <telerik:RadFluidContentControl Style="{StaticResource ResourceKey=FluidContentControlStyle}">
  
                <telerik:RadFluidContentControl.SmallContent>
                    <Grid>
                    </Grid>
                </telerik:RadFluidContentControl.SmallContent>
  
                <telerik:RadFluidContentControl.Content>
                    <Grid></Grid>
                </telerik:RadFluidContentControl.Content>
  
                <telerik:RadFluidContentControl.LargeContent>
                    <Grid>
                          
                    </Grid>
                </telerik:RadFluidContentControl.LargeContent>
  
            </telerik:RadFluidContentControl>
        </telerikNavigation:RadTileViewItem>
  
    </telerikNavigation:RadTileView>
</UserControl>


radtilecontrol.xaml.cs :

 

 

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;
  
namespace TileHiddenProblem
{
    /// <summary>
    /// Interaction logic for radTileControl.xaml
    /// </summary>
    public partial class radTileControl : UserControl
    {
        public radTileControl()
        {
            InitializeComponent();
             
        }
  
        public void ChangeTileState(string Name)
        {
              
            RadTileViewItem tileItem = new RadTileViewItem();
            switch (Name)
            {
                case "CallTile":
                    tileItem = tvc_MainTiles.Items[0] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Visible;
                    tileItem.TileState = TileViewItemState.Maximized;
                    break;
                case "MessageTile":
                    tileItem = tvc_MainTiles.Items[1] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Visible;
                    tileItem.TileState = TileViewItemState.Maximized;
                    break;
                case "CommandTile":
                    tileItem = tvc_MainTiles.Items[2] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Visible;
                    tileItem.TileState = TileViewItemState.Maximized;
                    break;
                case "ITServicesTile":
                    tileItem = tvc_MainTiles.Items[3] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Visible;
                    tileItem.TileState = TileViewItemState.Maximized;
                    break;
                case "SubscribersTile":
                    tileItem = tvc_MainTiles.Items[4] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Visible;
                    tileItem.TileState = TileViewItemState.Maximized;
                    break;
                case "GroupTile":
                    tileItem = tvc_MainTiles.Items[5] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Visible;
                    tileItem.TileState = TileViewItemState.Maximized;
                    break;
                case "ChangeTrackerTile":
                    tileItem = tvc_MainTiles.Items[6] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Visible;
                    tileItem.TileState = TileViewItemState.Maximized;
                    break;
                case "RecentCallsTile":
                    tileItem = tvc_MainTiles.Items[7] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Visible;
                    tileItem.TileState = TileViewItemState.Maximized;
                    break;
            }
        }
  
  
        public void ChangeTileStateHidden(string Name)
        {
            RadTileViewItem tileItem = new RadTileViewItem();
            switch (Name)
            {
                case "CallTile":
                    tileItem = tvc_MainTiles.Items[0] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Hidden;
  
                    break;
                case "MessageTile":
                    tileItem = tvc_MainTiles.Items[1] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Hidden;
                    break;
                case "CommandTile":
                    tileItem = tvc_MainTiles.Items[2] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Hidden;
                    break;
                case "ITServicesTile":
                    tileItem = tvc_MainTiles.Items[3] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Hidden;
                    break;
                case "SubscribersTile":
                    tileItem = tvc_MainTiles.Items[4] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Hidden;
                    break;
                case "GroupTile":
                    tileItem = tvc_MainTiles.Items[5] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Hidden;
                    break;
                case "ChangeTrackerTile":
                    tileItem = tvc_MainTiles.Items[6] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Hidden;
                    break;
                case "RecentCallsTile":
                    tileItem = tvc_MainTiles.Items[7] as RadTileViewItem;
                    tileItem.Visibility = Visibility.Hidden;
                    break;
            }
        }
  
        private void tvc_MainTiles_TilesStateChanged(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            foreach (RadTileViewItem radTileViewItem in tvc_MainTiles.Items)
            {
                if (radTileViewItem.Name == Name)
                    if (radTileViewItem.Visibility == Visibility.Hidden)
                    {
                        radTileViewItem.Visibility = Visibility.Visible;
                        radTileViewItem.TileState = TileViewItemState.Maximized;
                        return;
                    }
                    else
                    {
                        radTileViewItem.TileState = TileViewItemState.Restored;
                        radTileViewItem.Visibility = Visibility.Hidden;
  
                        return;
                    }
            }
        }
  
        private void tvc_MainTiles_Loaded(object sender, RoutedEventArgs e)
        {
            foreach (RadTileViewItem radTileViewItem in tvc_MainTiles.Items)
            {
                RadFluidContentControl fluidControl = radTileViewItem.ChildrenOfType<RadFluidContentControl>().First();
                if (fluidControl != null)
                {
                    switch (radTileViewItem.TileState)
                    {
                        case TileViewItemState.Maximized:
                            fluidControl.State = FluidContentControlState.Large;
                            break;
                        case TileViewItemState.Minimized:
                            fluidControl.State = FluidContentControlState.Small;
                            break;
                        case TileViewItemState.Restored:
                            fluidControl.State = FluidContentControlState.Normal;
                            break;
                    }
                }
            }
  
        }
    }
}


Zarko
Telerik team
 answered on 17 Oct 2012
5 answers
287 views
Hi,
I want to make the connectors gradient colored, from source to target. I can't figure out how to do it by setting Stroke style with GradientBrush. Can you help me?

here is what i tried(i know it works for left to right only):
<Setter Property="Stroke">
      <Setter.Value>
           <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
           <GradientStop Color="DimGray" Offset="0.0" />
           <GradientStop Color="Black" Offset="1" />
       </LinearGradientBrush>
     </Setter.Value>
</Setter>


 Thank you,
Sarper
Francois Vanderseypen
Top achievements
Rank 2
 answered on 17 Oct 2012
3 answers
131 views
I'm having trouble viewing telerik controls in blend, sometimes they are visible and can be edited through the wysiwyg editor, other time they are invisible and can only be manipulated via the code.  In either case, when i run the application they appear and function correctly, but now that i have some edits i need to make my not being able to see them in the editor is making things difficult.  Specifically, right now I am unable to see the RadTabControl and RadTabItems, and all the elements contained within.  Any thoughts?  Thanks!

Matt.
Stefan
Telerik team
 answered on 17 Oct 2012
2 answers
305 views
I have created a RadComboBox and bound the data to a Collection of strings. I wanted to add a new item to the list when "New" item in the RadComboxBox is selected. i.e. RadComboBox will be set to editable when "New" item is selected and the entered text has to be add to the existing list only when Enter pressed or LostFocus. Could you help me to achieve this ? 

XAML code to create the combobox with databinding 
<telerik:RadComboBox x:Name="SettingsNameList" ToolTip="Settings" Width="100" Height="25" ItemsSource="{Binding SettingsCV}" IsEditable="{Binding AddNewSetname,Mode=TwoWay}" Margin="120,5,550,0" Text="{Binding Path=NewSetName,Mode=TwoWay}" />

C# code to make the radcombobox editable and read the entered value,

SettingsCV.CurrentChanged += new EventHandler(SettingsCV_SelectedItemChanged);
 
private void SettingsCV_SelectedItemChanged(object sender, EventArgs e)
        {
            string item = SettingsCV.CurrentItem as string;
            if (item != null)
            {
                strDefaultSetName = item;
                if ("New" == strDefaultSetName)
                {
                    bEditable = true;
                    AddNewSetname = true;
                    //strNewSetName = "Default";
                                        //Raise property to update the UI
                    NotifyPropertyChanged("AddNewSetname");
                }
            }
        }

C# code to add the entered text to Collection

public string NewSetName
        {
            get
            {
                return strNewSetName;
            }
            set
            {
                strNewSetName  = value;
                strNewSetName.Trim();
                m_strSettingsCollection.Add(strNewSetName);
                SettingsCV = new ListCollectionView(m_strSettingsCollection);
                NotifyPropertyChanged("SettingsCV");
            }
        }

It would be good if i can set the default text when the combo box is editable.

Yana
Telerik team
 answered on 17 Oct 2012
1 answer
107 views
For easy coding we would like to use the DataGridViews feature DataLoadMode="Asynchronous" binding directly to the query.
Using this we do not need to manually code async EF I/O, the application does not block and by Binding the windows IsEnabled to the grids IsDirty we can easily block user input on the busy window.

If we use an ObservableCollection the I/O happens outside of the grid and thus is not async.
grid.ItemsSource = ObservableCollection(qry)

Without using an ObservableCollection I cannot get adds and deletes working.
For instance using grid.ItemsSource.Remove(grid.SelectedItem) plus db.RemoveObjet() seems not to work.

Is there an example for this scenario somewhere?

Peter Meinl
Top achievements
Rank 1
 answered on 17 Oct 2012
5 answers
103 views
Hi

Do you have any plans for including autoscroll-paging behavior in the WPF GridView ?
I am currently (re)investigating the possibilities of the WPF controls but this is something I definitely need.

We want:
- GridView connected to a DataServiceDataSource (working)
- GridView without Pager component (working)
- GridView loads only n items from datasource, based on Item RowHeight and GridView Height (not working)
- When vertical scrolling GridView loads n more items from datasource (not working)

Thanks
Vlad
Telerik team
 answered on 17 Oct 2012
4 answers
232 views
It appears that this control does not accept the DASH (-).
When using this for address type fields, the user would be required to enter a dash between street number address range.
Any way around this?
Tina Stancheva
Telerik team
 answered on 17 Oct 2012
1 answer
101 views
Hi

We are working on a project(WPF Client) and using RadSchedulerView that we need to define working days and for each working day needs to be different working hours?

Is any of these possible?

Best regards
Burim
Ventzi
Telerik team
 answered on 17 Oct 2012
3 answers
267 views
See attached image.

I am using most of RadDocking right out of the box, but have Themed the RadDocking and RadPaneGroup to Office_Blue in XAML using:

<Style TargetType="telerik:RadDocking">
        <Setter Property="telerik:StyleManager.Theme" Value="Office_Blue" />
    </Style>
    <Style TargetType="telerik:RadPaneGroup">
        <Setter Property="telerik:StyleManager.Theme" Value="Office_Blue" />
    </Style>
However, the AutoHideArea is wider than it needs to be and looks bloated and I would like to customize the "Toolbox" tab to be vertically longer.  I have searched and searched for info on how to do this but have come up empty.

Any help would be appreciated.
Masha
Telerik team
 answered on 17 Oct 2012
4 answers
303 views
Hi,
I have a button with a ListBox control as part of its dropdown content. The content also contains 'ok' and 'cancel' buttons to allow the user to dismiss the dropdown when they are done. I have run into a number of problems trying to get this to work. I don't know whether they are bugs or whether I should be doing this another way so I look forward to any comments that you may post.

Here they are:

1. When a listbox item is selected then the dropdown content closes. This happens because RadGallery.cs registers a handler that unconditionally closes the dropdown when a listbox selection changes. This seems like the right thing to do since there needs to be a way for the dropdown to close but inhis case it is undesirable since I have buttons that serve that function. What I am wondering is if an attached property could be created that could give the handler some direction about whether it should close the dropdown. I would then be able to attach this property to my listbox and the handler would know that it shouldn't close the dropdown.

2. I got around the 'listbox selection closing' problem by setting RadRibbonDropDownButton.KeepOpen = true but this brings on the next issue. 'KeepOpen' appears to work not by preventing the dropdown content from closing but by reopening after its been closed. This isn't obvious when interacting with the control but if you look at the call stack then you'll see that there is a call to 'IsOpen = false' that is quickly followed by a call to 'IsOpen = true'. The side effect of this is that every time a listbox item is selected then the 'DropDownOpening' event is raised. This is undesirable because I have some state variables that I would like to set only when the dropdown content is first displayed. My expectation was that this event would get called only when the drop down was opening and not additionally whenever a listbox item was selected.

3. This one is really more of a question followed by what may be a request. In order for my 'ok' and 'cancel' buttons to close the dropdown programmatically they must determine the RadRibbonDropDownButton control that the dropdown belongs to but I could find no straightforward way to do this other than giving the button a name and then referring to that name in the handlers. What I'd really like to do is to get this to work in a more generic way since my desire is to move the 'ok' and 'cancel' button handlers into a class which I would then use as a base class for other dropdown content. So the question is whether there is a way to do this that I am missing. If there is none then I have a request, which is for the RadRibbonDropDownButton to attach a property to the topmost visual of its dropdown (a popup I suppose) that indicates the RadRibbonDropDownButton that owns the dropdown.
Thanks and best regards,
Pete
Mohd
Top achievements
Rank 1
 answered on 17 Oct 2012
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?