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

-1 column exception

8 Answers 60 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Tamir
Top achievements
Rank 1
Tamir asked on 28 Dec 2012, 11:58 AM

Hello,
I am using your tileView in my app.
I am using a tile that every item in it is itself a tileView of user controls.
I am having an exception when I switch the itemsource of the outer tile (which effects the inner ones as well as they are binded to it).
The big tile's itemsource is binded to a treeview's itemsource. 
Whenever there is a change in the treeview's collection (the tree has checkboxes the decide which tiles will be visible) I am updating the binding manually (getting the binding expression and updating).
In a converter I convert the collection (a ListCollectionView of the viewmodel class of the user controls, filtered into groups) that I got from the tree to a collection that contains only the groups that are checked in the checkboxes (the groups are the outer tileItems). 
In the converter I copy the collection and delete only the groups that are unchecked (not supposed to be visible).
The user controls within each group are binded to a boolean property that tells the visibility of the items (with a converter).
The problem is that sometimes when I update the binding, I get notification of a tilePositionChanged of the inner tileView (that contains the user controls). 
The position that I get is -1, and that value does not come from my viewmodel (I checked).
Than I get an exception thrown because the tileView tries to put an item's column property to -1.
This does not happen every time, only when checking or unchecking an item and than I refresh the binding of the bigger TileView(which the inner ones are binded to).

I hope you have enough data.
unfortunately i can't attach the code.

Thank you in advanced,
Tamir.

8 Answers, 1 is accepted

Sort by
0
Denny
Top achievements
Rank 1
answered on 29 Apr 2013, 07:16 AM
Hello,

I have the same problem:

System.ArgumentException: '-1' is not a valid value for property 'Column'.
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.Controls.Grid.SetColumn(UIElement element, Int32 value)
   at Telerik.Windows.Controls.TileViewPanel.GetRestoredRect(RadTileViewItem child)
   at Telerik.Windows.Controls.TileViewPanel.ArrangeRestoredChildren()
   at Telerik.Windows.Controls.TileViewPanel.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
0
Zarko
Telerik team
answered on 01 May 2013, 12:27 PM
Hello Denny,
Unfortunately I wasn't able to reproduce this issue so I'd like to ask you some more information - what is your dlls' version, are your tileView items grouped, is the problem related to the tileStates of your items, do you change the visibility runtime, how exactly do you reproduce it and etc. Some code snippets would also help - a sample project would be best. 
I've attached the sample project that I used for testing so could you please take a look at it and tell us what you're doing differently?
We're looking forward to hearing from you.

Greetings,
Zarko
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
David
Top achievements
Rank 1
answered on 18 Sep 2013, 12:42 AM
Hi Zarko,

This error appears when Position property is used with TileViewItems that may be collapsed (but not in all cases). The following piece of code will throw the error as mentioned above: ('Visibility' in actual code is not hardcoded but bound to a property, hence determined at runtime). I'm using 2013 Q2 dlls.


<telerik:RadTileView x:Name="RadTileView1">
                <telerik:RadTileViewItem Header="Item1" Position="1">
                    <TextBlock Text="Item1 Content" />
                </telerik:RadTileViewItem>
                <telerik:RadTileViewItem Header="Item2" Position="2">
                    <TextBlock Text="Item2 Content" />
                </telerik:RadTileViewItem>
                <telerik:RadTileViewItem Header="Item3" Visibility="Collapsed"  Position="3">
                    <TextBlock Text="Item3 Content" />
                </telerik:RadTileViewItem>
                <telerik:RadTileViewItem Header="Item4" Position="4">
                    <TextBlock Text="Item4 Content" />
                </telerik:RadTileViewItem>
                <telerik:RadTileViewItem Header="Item5" Visibility="Collapsed"  Position="5">
                    <TextBlock Text="Item5 Content" />
                </telerik:RadTileViewItem>
                <telerik:RadTileViewItem Header="Item6" Position="6">
                    <TextBlock Text="Item6 Content" />
                </telerik:RadTileViewItem>
            </telerik:RadTileView>

Important: Now, if I set the Visibility of first TileViewItem as Collapsed, this code will work. Alternatively, If I remove the last 3 TileViewItems, the code works too. Hopefully it helps you fix the issue.
I got around by removing the Position property from the code for now, but will be good to have this bug/undocumented feature resolved as it took me a day to figure out the source of the problem.


Thanks
0
Zarko
Telerik team
answered on 18 Sep 2013, 03:49 PM
Hi David,
Thank you for the feedback and the code snippets. The issue in your case is that the positions of your items start from 1 when they should start from 0 (the position property is zero-based). You should be careful when you use both - position and visibility on initial loading because when you collapse an item it internally changes the positions of the items after it, so that there are no empty spaces and this could lead to problems (like in your case).
I hope I was able to help you and if you have further questions please feel free to ask.

Regards,
Zarko
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
sanjay kumar
Top achievements
Rank 1
answered on 05 Apr 2014, 07:00 PM
Hi Team,
I am facing issue with RadTileView. the error is shown below.
{"'-1' is not a valid value for property 'Column'."}
the code is working fine if i choose listbox instead of tileview.  I am trying to dynamically load content based on tile state.

Could you please help in this?

Regards,
Sanjay
0
Zarko
Telerik team
answered on 07 Apr 2014, 03:13 PM
Hi sanjay,
Could you please elaborate a little bit more on your scenario so that we could test it on our side and give you a better fix/workaround ? Also a sample application or some code snippets will be greatly appreciated.
We're looking forward to hearing from you again.

Regards,
Zarko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
sanjay kumar
Top achievements
Rank 1
answered on 07 Apr 2014, 04:16 PM
<telerik:RadTileView x:Name="RadTileList" ItemsSource="{Binding PluginViewModelList}" 
                             ContentTemplate="{StaticResource contentTemplate}" IsSelectionEnabled="True"
                   IsItemDraggingEnabled="{Binding ElementName=IsItemDraggingEnabledOption,
                                                   Path=IsChecked}"
                   ItemTemplate="{StaticResource headerTemplate}"
                  
                   MaximizeMode="{Binding ElementName=MaximizeModeOption,
                                       Path=SelectedItem}"
                   PreservePositionWhenMaximized="{Binding ElementName=PreservePositionWhenMaximizedOption,
                                                           Path=IsChecked}"
                   TileStateChangeTrigger="{Binding ElementName=StateChangeOption,
                                                   Path=SelectedItem}"
                             SelectedItem="{Binding SelectedTile}">
        </telerik:RadTileView>

Please have a look at the code. I have templates bind when the state changes from normal to maximized using radfluidcontrol.
0
Zarko
Telerik team
answered on 09 Apr 2014, 05:15 PM
Hello sanjay,
Thank you for the code snippet but unfortunately we're still not able to reproduce the issue so I'd like to ask you to open a support thread and send us a sample project demonstrating the exception there.
Zarko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TileView
Asked by
Tamir
Top achievements
Rank 1
Answers by
Denny
Top achievements
Rank 1
Zarko
Telerik team
David
Top achievements
Rank 1
sanjay kumar
Top achievements
Rank 1
Share this question
or