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

SL4 RC RadGrid: Value does not fall within expected Range

8 Answers 125 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Corey Gaudin
Top achievements
Rank 2
Corey Gaudin asked on 20 Mar 2010, 01:54 AM
It appears that the RadGrid is broken when inside of a RadTab.

I have 4 tabs. Each tab has a RadGrid that is bound to a ObservableCollection Property in a ViewModel and a DataForm below that is bound to its SelectedItem of the RadGrid.

If I select a row in a RadGrid it works fine. However, if I go to another tab and come back to the initial tab (or any tab where I had a selected row in the RadGrid), I throw a "Value does not fall within expected Range" error and it kills Silverlight.

It has to be the RadGrid or the RadTab crashing Silverlight, and it is not until I select a Row in the RadGrid and go to a different tab and come back to the tab that has the RadGrid with a selected row.

I cannot proceed with my project until this is resolved. Help me please ...

<TelerikControls:RadTabControl x:Name="DataFormTab" TabStripPlacement="Left" Align="Justify" VerticalAlignment="Stretch" Margin="5,5,5,5" Grid.Row="1" Grid.ColumnSpan="2">  
                <TelerikControls:RadTabItem Header="Platform Information">  
                    <localTabItem:PlatformInformation DataContext="{Binding PlatformViewModel}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>  
                </TelerikControls:RadTabItem> 
                <TelerikControls:RadTabItem Header="Well Information">  
                    <localTabItem:WellInformation DataContext="{Binding WellViewModel}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>  
                </TelerikControls:RadTabItem> 
                <TelerikControls:RadTabItem Header="Lease Information">  
                    <localTabItem:LeaseInformation DataContext="{Binding LeaseViewModel}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>  
                </TelerikControls:RadTabItem> 
                <TelerikControls:RadTabItem Header="Pipeline Information">  
                    <localTabItem:PipelineInformation DataContext="{Binding PipelineViewModel}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>  
                </TelerikControls:RadTabItem> 
            </TelerikControls:RadTabControl> 

Each of the user controls in the TabItems, as I said, contains a RadGrid and DataForm. I also have the SelectedItem of the RadGrid bound in my ViewModel to see if that would help it remember the selected item (since the RadTab recreates its controls of previous tabs), this has done nothing to help me.

8 Answers, 1 is accepted

Sort by
0
Corey Gaudin
Top achievements
Rank 2
answered on 20 Mar 2010, 05:43 PM
It appears if I un-bind the DataForm from the SelectedItem it doesnt throw the error. I even moved the Selected Object to the ViewModel as a ViewModel Property and do a 2-way bind on the from the RadGrid and a 1-way bind to the DataForm from the ViewModel and it still gives this error. Any ideas? It has to do with the re-creation of the Tab when you come back. Anything else I can try?
0
Corey Gaudin
Top achievements
Rank 2
answered on 20 Mar 2010, 05:43 PM
repost
0
Corey Gaudin
Top achievements
Rank 2
answered on 20 Mar 2010, 05:44 PM
repost
0
Vlad
Telerik team
answered on 23 Mar 2010, 07:25 AM
Hello Corey,

Can you post the stack trace? More info about the version of the controls (and the framework) will be appreciated as well.

Kind regards,
Vlad
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Corey Gaudin
Top achievements
Rank 2
answered on 23 Mar 2010, 07:48 PM
Thanks for the reply!

The DataForm I am using is from the Silverlight Toolkit version Silverlight 4 Beta bits (because they dont have a RC version). I believe the Silverlight 3 DataForm works fine in the same scenario using the RadTab and data-binding. I will get you the stacktrace tonight, but it is a Catastrophic Failure when trying to do a Dependency Bind if I recall correctly. My conclusion through looking at the stacktrace was that it was trying to bind to the CurrentItem of the DataForm. It works on initial, but if I select a row from the RadGrid and set the CurrentItem of the DataForm, tab to another one, and come back, it throughs this error.

StackTrace:

Code: 4004
Message: System.ArgumentException: Value does not fall within the expected range.


Message: Unhandled Error in Silverlight Application 
Code: 4004    
Category: ManagedRuntimeError       
Message: System.ArgumentException: Value does not fall within the expected range.
   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
   at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, DependencyObject doh)
   at MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
   at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
   at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
   at System.Windows.Controls.ContentPresenter.set_Content(Object value)
   at System.Windows.Controls.DataForm.GenerateUI(Boolean clearEntityErrors, Boolean swapOldAndNew)
   at System.Windows.Controls.DataForm.GenerateUI()
   at System.Windows.Controls.DataForm.OnApplyTemplate()
   at System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)     

Line: 60
Char: 4
Code: 0


0
Vlad
Telerik team
answered on 24 Mar 2010, 08:22 AM
Hi Corey,

The SL4 RC is available now - can you try your scenario to see what will be the result with the latest version?

Kind regards,
Vlad
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Corey Gaudin
Top achievements
Rank 2
answered on 24 Mar 2010, 02:47 PM
I am using the SL4 RC. I am using VS2010 RC, Silverlight 4 RC, Telerik Silverlight 4 RC binaries, but Silverlight 4 Beta Toolkit (because it does not have a RC Candidate at this time). As far as I know the difference from Beta to RC was mainly in the way it validates if a field is a problem without throwing an error. Could this change have something to do with the DataForm? Any chance of Telerik coming out with there own DataForm & Busy Indicator?
0
Hristo
Telerik team
answered on 30 Mar 2010, 10:35 AM
Hi Corey Gaudin,

Indeed Telerik has plans to introduce its own BusyIndicator and DataForm. The BusyIndicator is scheduled for Q2 2010 and DataForm will be available most probably for Q3 2010. You can track the progress of these controls in our Public Issue Tracking System (PITS) - for the BusyIndicator here and for the DataForm control here. You can also vote for them to affect their priority.


All the best,
Hristo
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Corey Gaudin
Top achievements
Rank 2
Answers by
Corey Gaudin
Top achievements
Rank 2
Vlad
Telerik team
Hristo
Telerik team
Share this question
or