Telerik Forums
UI for WPF Forum
1 answer
333 views
I'm populating a RadGridView with data that comes in asynchronously from a WCF service. The service sends blocks of records, say 200 at a time, which are then put into an ObservableCollection which is bound to the ItemsSource property of the grid. I would like to turn on Asynchronous loading of the data (DataLoadMode=Asynchronous), but when I do this, I get the following exception:

Collection was modified; enumeration operation may not execute.

at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)  
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()  
at System.Collections.Generic.List`1.Enumerator.MoveNext()  
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()  
at Telerik.Windows.Data.QueryableCollectionView.CreateInternalList() in c:\\Builds\\WPF_Scrum\\Core_WPF\\Sources\\Development\\Core\\Data\\Collections\\QueryableCollectionView.cs:line 423  
at Telerik.Windows.Data.QueryableCollectionView.get_InternalList() in c:\\Builds\\WPF_Scrum\\Core_WPF\\Sources\\Development\\Core\\Data\\Collections\\QueryableCollectionView.cs:line 406  
at Telerik.Windows.Data.QueryableCollectionView.GetEnumerator() in c:\\Builds\\WPF_Scrum\\Core_WPF\\Sources\\Development\\Core\\Data\\Collections\\QueryableCollectionView.cs:line 269  
at Telerik.Windows.Data.RecordFactory.<CreateRecordsForGroupRecord>d__0.MoveNext() in c:\\Builds\\WPF_Scrum\\Core_WPF\\Sources\\Development\\Core\\Data\\Data\\Records\\RecordFactory.cs:line 28  
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)  
at Telerik.Windows.Controls.GridView.GridViewDataControl.PopulateRecords() in c:\\Builds\\WPF_Scrum\\GridView_WPF\\Sources\\Development\\Controls\\GridView\\GridView\\GridView\\GridViewDataControl.cs:line 3178  
at Telerik.Windows.Controls.GridView.GridViewDataControl.OnAsyncDataLoadWorkerDoWork(Object sender, DoWorkEventArgs e) in c:\\Builds\\WPF_Scrum\\GridView_WPF\\Sources\\Development\\Controls\\GridView\\GridView\\GridView\\GridViewDataControl.cs:line 3153  
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)\r\n   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)" 

This is with the Q2 2009 release of the WPF controls.

The datasource will be continually updated and changed as records are added and deleted to it.

Any ideas on how I can get this to work safely?

Thanks!
Vlad
Telerik team
 answered on 13 Jul 2009
1 answer
86 views
Hi There

I am wondering if it is possible to change  row background colors programmatically instead of using the UseAlternateRowStyle property. Since the latter only allows to choose two colors. If possible, How?

Many thanks

Fu
Rossen Hristov
Telerik team
 answered on 10 Jul 2009
1 answer
174 views
I want to put a label with the unit inside my gauge, for example "C°", that is on the same place if i resize the gauge. How do i do?
Andrey
Telerik team
 answered on 10 Jul 2009
3 answers
142 views
Blend 2.5
RadControls 2008 Q3

Edit Control Parts (Template) > Edit a Copy > This Document >

Exception: Type Reference cannot find public type named 'RadGridView'

Any clue?
McLanahan Stevens
Top achievements
Rank 1
 answered on 09 Jul 2009
2 answers
100 views
Using the new facilities in the Q2 charts, e.g. strict mode, and the automatic label stepping - many thanks for doing these - I am now much happier with the radchart for the purpose I want to put it to - real time plotting of weather data. I've bound a line chart to a collection containing a DateTime and a temperature, and the resulting chart is working well, apart from the fact that it doesn't fill the whole X axis. Sometimes the gap at each end is quite large relative to the size of the plot, e.g:

http://nybbles.co.uk/images/chart1.jpg

The first point was actually plotted at about 21:20:30.

Is it possible to make the line fill the chart?

Steve



SteveL
Top achievements
Rank 2
 answered on 09 Jul 2009
3 answers
203 views
Hi

I've been following this example for binding to object data.

However I can't specify the <DataTemplate>.

Instead I get the message "Property 'VisualTree' does not support values of type 'DataTemplate'".

What am I doing wrong?
<UserControl x:Class="ReportDistribution.Client.ReportMgr.WpfApp.UserControls.ReportMenuPanel" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    Height="300" Width="270"
    <UserControl.Resources>         
        <ItemsControl> 
            <ItemsControl.ItemTemplate> 
                <HierarchicalDataTemplate x:Key="Entity" ItemsSource="{Binding ClientReport}">                    
                    <DataTemplate> 
                        <TextBlock Text="{Binding Name}"></TextBlock> 
                    </DataTemplate> 
                </HierarchicalDataTemplate> 
            </ItemsControl.ItemTemplate> 
        </ItemsControl>    
    </UserControl.Resources> 
    <Grid>         
        <Grid.RowDefinitions> 
            <RowDefinition Height="35"></RowDefinition> 
            <RowDefinition></RowDefinition
        </Grid.RowDefinitions> 
        <Grid.ColumnDefinitions> 
            <ColumnDefinition></ColumnDefinition
        </Grid.ColumnDefinitions> 
        <Border Grid.Row="0" BorderBrush="Black" BorderThickness="1"
            <Border.Background> 
                <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"
                    <GradientStop Color="#ADCFFF" /> 
                    <GradientStop Color="#599BFF" Offset="1"></GradientStop> 
                </LinearGradientBrush> 
            </Border.Background> 
        </Border> 
        <TextBlock Grid.Row="0" VerticalAlignment="Center" FontSize="14" FontWeight="Bold" Margin="5">Reports</TextBlock> 
        <Border Grid.Row="1" BorderBrush="Black" BorderThickness="1,0,1,1"
            <Border.Background> 
                <SolidColorBrush Color="White" /> 
            </Border.Background> 
        </Border> 
        <telerik:RadPanelBar x:Name="reportMenuPanelBar" Grid.Row="1" Margin="1,0,1,1" ItemTemplate="{StaticResource Entity}" ItemsSource="{Binding}"
             
        </telerik:RadPanelBar> 
                 
    </Grid> 
</UserControl> 



Tihomir Petkov
Telerik team
 answered on 09 Jul 2009
2 answers
247 views
Hello

My WPF RadGridView is bound to a list of business objects using its ItemsSource property. So far we were using the grid's Records property to get all objects that are being displayed after filtering and in the current sort order. In the latest version of the WPF control suite (Q2 2009) mostly everything related to RadGridView.Records (Record and DataRecord class) is marked as obsolete. So how to get the list of displayed items now?

I've already tried CollectionViewSource.GetDefaultView(myGrid.ItemsSource) but this gets the whole list not only the list after filtering.

Thanks for any help

Christian
Christian
Top achievements
Rank 1
 answered on 09 Jul 2009
10 answers
164 views
Hi,

Is the Filtered event not raised on purpose when the Clear Filter button is clicked?

Thanks.
Vlad
Telerik team
 answered on 09 Jul 2009
1 answer
161 views
I have a "hidden" column (made visible for debugging) called "Index" that I am sorting by...  When I first load the grid, the grid is loaded in the correct way - but probably because my list of objects is already sorted.  I implemented some custom commands attached to buttons inside the GridViewRow Template for moving objects UP or DOWN in the grid.  When the Move Up or Move Down buttons are pressed, the items are removed from the list, inserted at the right location and the list's Index properties are corrected for the new order...

BUT The first time I press Move Up or Move Down, the index changes (I see the indexes in the data records change), but the grid doesn't refresh the items.   The NEXT time I press either button, the grid resorts but not in a nice way...  Items are always in the wrong order.

For example:

Start with these objects in the grid
1 - AAA
2 - BBB
3 - CCC

Move Down for object AAA: Remove object AAA, insert at new spot in list, reindex.  Grid shows:
2- AAA
1 - BBB
3 - CCC

Move Down for object AAA: Remove object AAA, insert at new spot in list, reindex.  Grid shows:
2 - CCC
1 - AAA
3 - BBB

I may have to put a small sample together but I'm hoping not. Here is how I  have my grid defined:

            <telerik:RadGridView x:Name="SettingsGrid" ItemsSource="{Binding ElementName=UC, Path=CurrentTeamProjectList}" ScrollMode="RealTime"  
                                     AutoGenerateColumns="False" ShowGroupPanel="False" IsFilteringAllowed="False" ColumnsWidthMode="Fill" ShowColumnHeaders="False" 
                                     CanUserFreezeColumns="False" CanUserReorderColumns="False" CanUserSortColumns="False" VerticalGridlinesVisibility="Hidden" 
                                     Margin="4,2,4,2" Loaded="SettingsGrid_Loaded"
 
                <telerik:RadGridView.Columns> 
                    <telerik:GridViewDataColumn UniqueName="Index" IsReadOnly="True" DataType="{x:Type System:Int32}"/> 
                    <telerik:GridViewDataColumn UniqueName="Name" IsReadOnly="True" DataType="{x:Type System:String}"/> 
                    <telerik:GridViewDataColumn UniqueName="Boolean1" DataType="{x:Type System:Boolean}"/> 
                    <telerik:GridViewDataColumn UniqueName="Boolean2" DataType="{x:Type System:Boolean}"/> 
                    <telerik:GridViewDataColumn UniqueName="NumSeconds" DataType="{x:Type System:Int32}"/> 
                </telerik:RadGridView.Columns> 
                <telerik:RadGridView.SortDescriptions> 
                    <cm:SortDescription PropertyName="Index" Direction="Ascending" /> 
                </telerik:RadGridView.SortDescriptions> 
            </telerik:RadGridView> 
 

I tried adding a SortDescription object to the SortDescriptions collection in the grid loaded event, but that did the same thing.

Thoughts?
Greg
GPJ
Top achievements
Rank 1
 answered on 08 Jul 2009
2 answers
105 views
Hi,

I have implemented a custom GridViewRow Template but the vertical scrolling of the grid is gone...  I'm not sure if I turned it off though since there doesn't seem to be any property like "VerticalScrollBarVisibility" to set?
       
Here is a sample of how I am defining my grid:

            <telerik:RadGridView x:Name="SettingsGrid" ItemsSource="{Binding ElementName=UC, Path=CurrentSettingList}" ScrollMode="RealTime"  
                                     AutoGenerateColumns="False" ShowGroupPanel="False" IsFilteringAllowed="False" ColumnsWidthMode="Fill" ShowColumnHeaders="False" 
                                     CanUserFreezeColumns="False" CanUserReorderColumns="False" CanUserSortColumns="False" VerticalGridlinesVisibility="Hidden" 
                                     Margin="4,2,4,2" Loaded="SettingsGrid_Loaded"
 

Greg
GPJ
Top achievements
Rank 1
 answered on 08 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?