Telerik Forums
UI for WPF Forum
1 answer
114 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
129 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
150 views
Is there a way to filter by nulls ?

Thanks !
Rossen Hristov
Telerik team
 answered on 29 Sep 2010
1 answer
97 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
206 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
102 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
174 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
430 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
842 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
1 answer
153 views
Hi,
  I was trying to use the dynamic layer and my goal was to only get items within the viewport. My data is stored with a quadkey up to lever 2^14 and because of that  I need to set the ZoomGrid to 2^level * 2^level cells.
    Looking with reflector in the the DynamicLayer code I've realized that the call back for getting the items for a particular cell is iterating through the entire cell set rather than being restirected to the one in the view.
  This is obviously causing the application to freeze on high levels(9+). Am I missing something in my implementation? 
   Are there any plans to introduce a DynamicLayer class that is similar with the Bing Tile system? I would take any beta version into consideration as where I am standing now I have to implement my own. Please advise!
Regards,
Dan
Andrey
Telerik team
 answered on 28 Sep 2010
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?