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

issue in removing Tiles from Group

7 Answers 140 Views
TileList
This is a migrated thread and some comments may be shown as answers.
Ummar
Top achievements
Rank 1
Ummar asked on 27 Mar 2015, 01:30 PM
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,
      

7 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 01 Apr 2015, 10:33 AM
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.

 
0
Ummar
Top achievements
Rank 1
answered on 01 Apr 2015, 12:59 PM
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!
0
Maya
Telerik team
answered on 03 Apr 2015, 02:02 PM
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.

 
0
Muhammad Ummar
Top achievements
Rank 1
answered on 10 Apr 2015, 06:31 AM

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

0
Maya
Telerik team
answered on 13 Apr 2015, 10:29 AM
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.

 
0
Muhammad Ummar
Top achievements
Rank 1
answered on 23 Jun 2015, 08:26 AM

Hello Maya,

Can I get this fix now?

 Regards

0
Maya
Telerik team
answered on 23 Jun 2015, 01:57 PM
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
Tags
TileList
Asked by
Ummar
Top achievements
Rank 1
Answers by
Maya
Telerik team
Ummar
Top achievements
Rank 1
Muhammad Ummar
Top achievements
Rank 1
Share this question
or