issue in removing Tiles from Group

9 posts, 0 answers
  1. Ummar
    Ummar avatar
    3 posts
    Member since:
    Mar 2015

    Posted 27 Mar 2015 Link to this post

    Hello,
            My team just upgraded the telerik version (2015.1.225.45) and the tiles functionality is now completely changed as the group property of tile is now only read only.
     I am getting error "the given key is not present in dictionary" when removing the tile from group only when setting display index property for group.
     i got rid of that error when setting display index of group to null but the drag/drop functionality of tiles within groups doesn't work now. 
    Here is the xaml code:

    <Grid>
            <Grid.ColumnDefinitions/>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
            </Grid.RowDefinitions>
             
            <Grid.Resources>
                 
                <Style TargetType="{x:Type telerik:Tile}">
                    <Setter Property="TileType" Value="{Binding TileSize}" />
                </Style>
            </Grid.Resources>
            <telerik:RadTileList x:Name="RadTileList" VerticalTilesAlignment="Top" Grid.Row="2">
                <telerik:RadTileList.ItemsPanel>
                    <ItemsPanelTemplate>
                        <telerik:TileListGroupPanel />
                    </ItemsPanelTemplate>
                </telerik:RadTileList.ItemsPanel>
            </telerik:RadTileList>
     
            <Button Width="100" Height="100" Grid.Row="0" HorizontalAlignment="Left" Content="Button" Click="Button_Click_1"></Button>
             
        </Grid>

    Button added to remove tile. Here is the code behind:

    public partial class MainWindow : Window
        {
            ObservableCollection<TileGroup> group;
            ObservableCollection<Tile> tiles = new ObservableCollection<Tile>();
            Tile t;
     
            Tile t1;
            Tile t2;
            Tile t3;
     
            public MainWindow()
            {
                InitializeComponent();
     
                //Groups
                var groups_collection = new ObservableCollection<TileGroup>();
                groups_collection.Add(new TileGroup() { Header = "Group 1", DisplayIndex=0});
                groups_collection.Add(new TileGroup() { Header = "Group 2" ,DisplayIndex=1});
                groups_collection.Add(new TileGroup() { Header = "Group 3" ,DisplayIndex=2});
     
                //Tiles
                t1 = new Tile() { Content = "Tile 1"};
                t2 = new Tile() { Content = "Tile 2" };
     
                //Grouping tile
                groups_collection[0].Items.Add(t1);
                groups_collection[1].Items.Add(t2);
     
                //Add in TileList
                RadTileList.Groups.Add(groups_collection[0]);
                RadTileList.Groups.Add(groups_collection[1]);
     
            }
     
            private void Button_Click_1(object sender, RoutedEventArgs e)
            {
                RadTileList.Groups[0].Items.RemoveAt(0);
     
            }
     
        }

    Regards,
          
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 01 Apr 2015 Link to this post

    Hello Ummar,

    This is a known issue and we are working on its fix. For the time being the way to go is to define the groups in xaml. I do hope this is an acceptable workaround for your scenario. 
    I will write you back once we have a solution.

    Regards,
    Maya
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Ummar
    Ummar avatar
    3 posts
    Member since:
    Mar 2015

    Posted 01 Apr 2015 in reply to Maya Link to this post

    Hello Maya,
          Thanks for reply, Unfortunately as with our business logic, we can't move forward with xaml approach. Moreover, we are facing another issue, when dragging a tile from one group to another it gives error "the given key is not present in dictionary". Xaml Code is same as above, but again posting:
    <Grid>
           <Grid.ColumnDefinitions/>
           <Grid.RowDefinitions>
               <RowDefinition Height="auto"></RowDefinition>
               <RowDefinition Height="auto"></RowDefinition>
               <RowDefinition Height="auto"></RowDefinition>
           </Grid.RowDefinitions>
            
           <Grid.Resources>
                
               <Style TargetType="{x:Type telerik:Tile}">
                   <Setter Property="TileType" Value="{Binding TileSize}" />
               </Style>
           </Grid.Resources>
           <telerik:RadTileList x:Name="RadTileList" VerticalTilesAlignment="Top" Grid.Row="2">
               <telerik:RadTileList.ItemsPanel>
                   <ItemsPanelTemplate>
                       <telerik:TileListGroupPanel />
                   </ItemsPanelTemplate>
               </telerik:RadTileList.ItemsPanel>
           </telerik:RadTileList>
     
           <Button Width="100" Height="100" Grid.Row="0" HorizontalAlignment="Left" Content="Button" Click="Button_Click_1"></Button>
            
       </Grid>
    Here is the code behind:
    public partial class MainWindow : Window
        {
            ObservableCollection<TileGroup> group;
            ObservableCollection<Tile> tiles = new ObservableCollection<Tile>();
            Tile t;
     
            Tile t1;
            Tile t2;
            Tile t3;
            Tile t4;
            Tile t5;
            Tile t6;
            Tile t7;
            Tile t8;
     
     
            public MainWindow()
            {
                InitializeComponent();
     
                //Groups
                var groups_collection = new ObservableCollection<TileGroup>();
                groups_collection.Add(new TileGroup() { Header = "Group 1",DisplayIndex=0});
                groups_collection.Add(new TileGroup() { Header = "Group 2",DisplayIndex=1});
                groups_collection.Add(new TileGroup() { Header = "Group 3",DisplayIndex=2});
                groups_collection.Add(new TileGroup() { Header = "Group 4",DisplayIndex=3});
                groups_collection.Add(new TileGroup() { Header = "Group 5", DisplayIndex = 4 });
                groups_collection.Add(new TileGroup() { Header = "Group 6", DisplayIndex = 5 });
     
                //Tiles
                t1 = new Tile() { Content = "Tile 1"};
                t2 = new Tile() { Content = "Tile 2" };
                t3 = new Tile() { Content = "Tile 3" };
                t4 = new Tile() { Content="Tile4"};
                t5 = new Tile() { Content = "Tile5" };
                t6 = new Tile() { Content = "Tile6" };
                t7 = new Tile() { Content = "Tile7" };
                t8 = new Tile() { Content = "Tile8" };
                 
     
                //Grouping tile
                groups_collection[0].Items.Add(t1);
                groups_collection[0].Items.Add(t2);
                groups_collection[1].Items.Add(t3);
     
                groups_collection[2].Items.Add(t4);
                groups_collection[3].Items.Add(t5);
                groups_collection[4].Items.Add(t6);
                groups_collection[5].Items.Add(t7);
                groups_collection[5].Items.Add(t8);
     
                //Add in TileList
                RadTileList.Groups.Add(groups_collection[0]);
                RadTileList.Groups.Add(groups_collection[1]);
                RadTileList.Groups.Add(groups_collection[2]);
                RadTileList.Groups.Add(groups_collection[3]);
                RadTileList.Groups.Add(groups_collection[4]);
                RadTileList.Groups.Add(groups_collection[5]);
                 
     
            }
     
            private void Button_Click_1(object sender, RoutedEventArgs e)
            {
                if (RadTileList.Groups[0].Items.Count > 1)
                {
                    RadTileList.Groups[0].Items.RemoveAt(0);
                }
                else
                {
                    t2.Group.DisplayIndex = 0;
                    RadTileList.Groups.Remove(t3.Group);
                }
            }
        }

    the snapshots are attached. Please see this!
    Thanks!
  5. Ummar
    Ummar avatar
    3 posts
    Member since:
    Mar 2015

    Posted 01 Apr 2015 in reply to Maya Link to this post

    hello Maya,
          Thanks for reply, but unfortunately our business logic doesn't allow this approach of xaml. 
           Moreover, we are facing another problem when moving tile from one group to another, the xaml code is same as abobe 
    <Grid>
            <Grid.ColumnDefinitions/>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
            </Grid.RowDefinitions>
             
            <Grid.Resources>
                 
                <Style TargetType="{x:Type telerik:Tile}">
                    <Setter Property="TileType" Value="{Binding TileSize}" />
                </Style>
            </Grid.Resources>
            <telerik:RadTileList x:Name="RadTileList" VerticalTilesAlignment="Top" Grid.Row="2">
                <telerik:RadTileList.ItemsPanel>
                    <ItemsPanelTemplate>
                        <telerik:TileListGroupPanel />
                    </ItemsPanelTemplate>
                </telerik:RadTileList.ItemsPanel>
            </telerik:RadTileList>
     
            <Button Width="100" Height="100" Grid.Row="0" HorizontalAlignment="Left" Content="Button" Click="Button_Click_1"></Button>
             
        </Grid>

    Here is the codebehind:

    public partial class MainWindow : Window
       {
           ObservableCollection<TileGroup> group;
           ObservableCollection<Tile> tiles = new ObservableCollection<Tile>();
           Tile t;
     
           Tile t1;
           Tile t2;
           Tile t3;
           Tile t4;
           Tile t5;
           Tile t6;
           Tile t7;
           Tile t8;
     
     
           public MainWindow()
           {
               InitializeComponent();
     
               //Groups
               var groups_collection = new ObservableCollection<TileGroup>();
               groups_collection.Add(new TileGroup() { Header = "Group 1",DisplayIndex=0});
               groups_collection.Add(new TileGroup() { Header = "Group 2",DisplayIndex=1});
               groups_collection.Add(new TileGroup() { Header = "Group 3",DisplayIndex=2});
               groups_collection.Add(new TileGroup() { Header = "Group 4",DisplayIndex=3});
               groups_collection.Add(new TileGroup() { Header = "Group 5", DisplayIndex = 4 });
               groups_collection.Add(new TileGroup() { Header = "Group 6", DisplayIndex = 5 });
     
               //Tiles
               t1 = new Tile() { Content = "Tile 1"};
               t2 = new Tile() { Content = "Tile 2" };
               t3 = new Tile() { Content = "Tile 3" };
               t4 = new Tile() { Content="Tile4"};
               t5 = new Tile() { Content = "Tile5" };
               t6 = new Tile() { Content = "Tile6" };
               t7 = new Tile() { Content = "Tile7" };
               t8 = new Tile() { Content = "Tile8" };
                
     
               //Grouping tile
               groups_collection[0].Items.Add(t1);
               groups_collection[0].Items.Add(t2);
               groups_collection[1].Items.Add(t3);
     
               groups_collection[2].Items.Add(t4);
               groups_collection[3].Items.Add(t5);
               groups_collection[4].Items.Add(t6);
               groups_collection[5].Items.Add(t7);
               groups_collection[5].Items.Add(t8);
     
               //Add in TileList
               RadTileList.Groups.Add(groups_collection[0]);
               RadTileList.Groups.Add(groups_collection[1]);
               RadTileList.Groups.Add(groups_collection[2]);
               RadTileList.Groups.Add(groups_collection[3]);
               RadTileList.Groups.Add(groups_collection[4]);
               RadTileList.Groups.Add(groups_collection[5]);
                
     
           }
     
           private void Button_Click_1(object sender, RoutedEventArgs e)
           {
               if (RadTileList.Groups[0].Items.Count > 1)
               {
                   RadTileList.Groups[0].Items.RemoveAt(0);
               }
               else
               {
                   t2.Group.DisplayIndex = 0;
                   RadTileList.Groups.Remove(t3.Group);
               }
           }
       }

    the snapshot which contains stacktrace and error is also attached, Thanks!
  6. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 03 Apr 2015 Link to this post

    Hello,

    Actually, both issues are related and the fix for the first one will be the solution for the second. Unfortunately, for the time being my suggestion would be again to generate the elements in xaml. 



    Regards,
    Maya
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  7. Muhammad Ummar
    Muhammad Ummar avatar
    26 posts
    Member since:
    Jul 2012

    Posted 10 Apr 2015 in reply to Maya Link to this post

    Hello Maya, 

     Thanks for the clarification on the issues. But we don't have option to move to XAML based tiles as per our current business logic. Could you please let me know any estimated time when these issues will be fixed?

     Just for your information previously we were using version 2014.1.331.45, and it was working fine, one of many reasons we moved to latest version is "VerticalTilesAlignment" property. But the latest version has many other issues, which has broken the core functionality of our application.

     Regards

    Ummar

  8. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 13 Apr 2015 Link to this post

    Hello Ummar,

    I resolved the issue and the fix will be available in one of our next internal builds. Please follow the progress in our feedback portal for more information about its completion. 



    Regards,
    Maya
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  9. Muhammad Ummar
    Muhammad Ummar avatar
    26 posts
    Member since:
    Jul 2012

    Posted 23 Jun 2015 in reply to Maya Link to this post

    Hello Maya,

    Can I get this fix now?

     Regards

  10. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 23 Jun 2015 Link to this post

    Hello Muhammad,

    I just replied in the feedback item


    Regards,
    Maya
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WPF is Visual Studio 2017 Ready