Telerik Forums
UI for WPF Forum
1 answer
67 views
Hi,

I'm using MVVM auto binding to create a Bar Chart

in my xaml,

 

<telerikChart:RadChart Width="200" Height="200" ItemsSource="{Binding DisplayedCapacitySeries}" Padding="3">
.... 
 <telerik:SeriesMapping.ItemMappings>  
    <telerik:ItemMapping DataPointMember="YValue" FieldName="Capacity_TB"/>   
     <telerik:ItemMapping DataPointMember="XCategory" FieldName="CapacityName" />   
 </telerik:SeriesMapping.ItemMappings>


The chart was created at the first loading. However, the Chart is not refreshed when Caparity_TB is changed although INotifyPropertyChanged is implemented in the ViewModel class. 

Also I want to show the legend with the CapacityName. I'm using LegendDisplayMode="DataPointLabel". However, the legend shows as "item 0 .. item 1" instead of the CapacityName on the XCategory.

Also how can I hide the legend header?
 

 


Thanks,
Ves
Telerik team
 answered on 29 Sep 2010
1 answer
112 views

Hello,

I have a WPF application which incorporates the MVVM pattern. I have a viewmodel class which basically has two properties:

01.private SeriesMappingCollection _mapCollection;
02.private ArrayList _joints;

03.public SeriesMappingCollection MapCollection
04.{
05.    get { return _mapCollection; }
06.    set
07.    {
08.         if (_mapCollection != value)
09.         {
10.              _mapCollection = value;
11.              OnPropertyChanged("MapCollection");
12.         }              
13.     }
14.}      
15.  
16.public ArrayList Joints
17.{
18.     get { return _joints; }
19.     set
20.     {
21.           if (_joints != value)
22.           {
23.               _joints = value;
24.               OnPropertyChanged("Joints");
25.           }
26.      
27.}


The values of Mapcollection and Joints are set using a BackgroundWorker. When the data has been fetched, the GetAlertCompleted function is fired and the Mapcollection and Joints properties are set. This consequently fires the OnPropertyChanged() function of the view model 

01.public ViewModel()
02.{
03.       workerAlerts = new BackgroundWorker();
04.       workerAlerts.DoWork += (o, args) => args.Result = 
05.           VizBackend.GetAlert.(_ipAdd,_selectedPeriod);
06.              
07.       workerAlerts.RunWorkerCompleted += GetAlertCompleted;
08.}
09.  
10.private void GetAlertCompleted(object sender, RunWorkerCompletedEventArgs e)
11.{
12.  
13.     var alertData = e.Result as AlertData;
14.     Joints = alertData.Joints;
15.     MapCollection = alertData.MapCollection;
16. }

And in the main window I have:

01.private readonly ViewModel vm;
02.vm = (ViewModel)DataContext;
03.vm.PropertyChanged += VmPropertyChanged;
04.  
05.private void VmPropertyChanged(object sender, PropertyChangedEventArgs e)
06.        {
07.            switch (e.PropertyName)
08.            {
09.                case "MapCollection":
10.                    this.radChart.SeriesMappings = vm.MapCollection;
11.                    break;
12.  
13.                case "Joints":
14.                    this.radChart.ItemsSource = vm.Joints;
15.                    break;
16.            }
17.        }
The problem is that when I assign the first property of the RadChart ( for example ItemsSource), I cant set the SeriesMappings property and I receive this error "The calling thread cannot access this object because a different thread owns it". I have no idea why this error is being raised. If I can set one property, why cant I set the second one. And it also doesnt matter in which order they are assigned. Once the first is assigned, I get an error for the second one. 


I would appreciate if you could point out where the problem might be. Thanks.


Yavor
Telerik team
 answered on 29 Sep 2010
1 answer
124 views
Hi,

Can you please share sample code for printing WPF grid data using c#.
 
I tried the online demos avaliable at telerik site for GridView, it is showing "Example not supported in XBAP enviornment". I've tried silverlight code but showing errors.

Thanks,
-Narendra

Pavel Pavlov
Telerik team
 answered on 29 Sep 2010
3 answers
142 views
Is there a way to filter by nulls ?

Thanks !
Rossen Hristov
Telerik team
 answered on 29 Sep 2010
1 answer
93 views
Hello,

I am trying to display the row count on the raddatapager instead of footer. Is this possible? If so, is there an example somewhere?

Thank You in advance,
Kal
Rossen Hristov
Telerik team
 answered on 29 Sep 2010
1 answer
197 views
Hello,

I am trying to display the row count on the raddatapager instead of footer. Is this possible? If so, is there an example somewhere?

Thank You in advance,
Kal
Rossen Hristov
Telerik team
 answered on 29 Sep 2010
1 answer
98 views
Hi,

I am testing RadGridView control for our needs. I bind a DataTable instance to the control but the column names of the control are empty. AutoGenerateColumns property is set to true. I want to set the column names of the DataTable instance to the grid control.

Thank you.
Yordanka
Telerik team
 answered on 29 Sep 2010
11 answers
159 views
Hello :)

I have a gridview and the filter menu is clipped, the "Filter" and "ClearFilter" buttons are not shown.
I have attached  a screenshot of this.

I hope you can help me.
Best regards
Jorge
Ramin
Top achievements
Rank 1
 answered on 28 Sep 2010
7 answers
423 views
I have a very simple problem. I have a list of cars and each car can further contain its name and a list of parts that consist the car. Now i want to show the cars(names) in a grid and the corresponding parts in a combobox in the same row using GridViewComboBoxColumn.
I have set the itemsource property of grid to Cars. Then i used the GridViewDataColumn's unique name to display the name and item source property of GridViewComboBoxColumn to display parts. Here is the code

 

 

 

 

 

<

 

telerik:RadGridView Name="UserListGrid" DockPanel.Dock="Top" Height="520"

 

 

ScrollMode="RealTime"

 

 

UseAlternateRowStyle="True"

 

 

AutoGenerateColumns="False"

 

 

ShowGroupPanel="False"

 

 

IsReadOnly="False"

 

 

RowIndicatorVisibility ="Visible"

 

 

CanUserFreezeColumns="False"

 

 

SelectionMode="Single"

 

 

ItemsSource="{Binding OperatorInfoItems, Mode=TwoWay}"

 

 

SelectedItem="{Binding SelectedRow, Mode=TwoWay}"

 

 

IsSynchronizedWithCurrentItem="True"

 

 

SelectionChanged="UserListGrid_SelectionChanged">

 

 

 

<telerik:RadGridView.Columns>

 

 

 

<telerik:GridViewDataColumn UniqueName="Cars" DataType="{x:Null}" Header="Names" IsVisible="True" IsFilterable="False" IsGroupable="False" IsReadOnly="True" IsSortable="False" Width="150"/>

 

 

 

<telerik:GridViewComboBoxColumn ItemsSource="{Binding Parts}" Header="Parts"/>

 

 

 

</telerik:RadGridView.Columns>

 

 

 

</telerik:RadGridView>

 

 

 

 

 

But after running the project i could only see names and a data binding error message instead of a populated combobox.
Pl tell me what to do.

 

 

 

 

 

 

 

 

 

 

Maya
Telerik team
 answered on 28 Sep 2010
5 answers
826 views
Hi telerik,
as part of my custom control development for button control, i need to have a button content with a combination of the image
and a text (side by side). i need to change the image to a different image when i place my cursor on to the button and change to
original image when the mouse leaves the control.

how to acheive this in generic.xaml and my cs file?

Regards,
srinivas J
Zarko
Telerik team
 answered on 28 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?