Telerik Forums
UI for WPF Forum
1 answer
164 views
Guys,

I have the following xaml below and bind my POI's ect via the ItemsSource Binding on the information layer. The information layer itself gets its shapedata by once static source for Asia.

Once I run the application I get the following exception:
Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead.

Is there any workaround you could offer in order to bind my map elements/POI's using the itemssource AND have the MapShapes configured in the XAML? I'd like to use as much MVVM I can and therefor I'd like to use data binding to my viewmodel.

Thanks,

XAML:

 
   <telerik:RadMap x:Name="radMap" CommandBarVisibility="Visible" IsTextSearchEnabled="False">
            <telerik:RadMap.Provider>
                <telerik:EmptyProvider/>
            </telerik:RadMap.Provider>
            
        <telerik:InformationLayer x:Name="informationLayer" ItemsSource="{Binding MapData}">
        
            
                           
                <telerik:InformationLayer.Reader>
                    <telerik:MapShapeReader DataSource="/DTClientServices.PlanningSuite.Views;component/Shapefiles/Asia/asia.dbf" Source="/DTClientServices.PlanningSuite.Views;component/Shapefiles/Asia/asia.shp" ClearLayer="False" />
                </telerik:InformationLayer.Reader>
                
       
                <telerik:InformationLayer.ItemTemplate>
                    <DataTemplate>
                        <Grid telerik:MapLayer.BaseZoomLevel="{Binding BaseZoomLevel}"
                       telerik:MapLayer.Location="{Binding Location}"
                       telerik:MapLayer.ZoomRange="{Binding ZoomRange}">
                            <telerik:MapLayer.HotSpot>
                                <telerik:HotSpot X="0.5"
                                           Y="0.5"
                                           ElementName="PART_Ellipse" />
                            </telerik:MapLayer.HotSpot>
                            <Ellipse x:Name="PART_Ellipse"
                               Width="20"
                               Height="20"
                               Stroke="Red"
                               StrokeThickness="3"
                               Fill="Transparent">
                                <ToolTipService.ToolTip>
                                    <ToolTip Content="{Binding Caption}" />
                                </ToolTipService.ToolTip>
                            </Ellipse>
                        </Grid>
                    </DataTemplate>
                </telerik:InformationLayer.ItemTemplate>
            </telerik:InformationLayer>
        </telerik:RadMap>
Andrey
Telerik team
 answered on 22 Aug 2011
3 answers
125 views
Hi,

I don't see possibility to create recuring appointment "every last Monday of every 2 month". In help i found only "How to Create an Appointment that Occurs on Every "n-th" Week Day and the Interval Between Each Recurrence is "m" Months" and for this is used DayOrdinal property.

If support ticket would help to resolve this quicker let me know.

Thanks,
Saulius
Valeri Hristov
Telerik team
 answered on 22 Aug 2011
1 answer
143 views
Hello,

My wpf application has a UserControl that host a transition control. The transition control gets it's TransPages loaded in code.

#region Create our singleton that has the default pages
 
                //add our pages...hard coded for now
                TransPage tp_MVW = new TransPage();
                tp_MVW.DisplayName = "MVW";
                tp_MVW.PageUri = "/SSODemo;component/uc_MVW_Host.xaml";
 
                TransPage tp_MediT = new TransPage();
                tp_MediT.DisplayName = "MediTech";
                tp_MediT.PageUri = "/SSODemo;component/uc_TechHost.xaml";
 
                TransPage tp_Google = new TransPage();
                tp_Google.DisplayName = "Google";
                tp_Google.PageUri = "/SSODemo;component/uc_Google_Host.xaml";
 
                Props.TransitionMap = TransMap.Single_TransMap;
 
                Props.TransitionMap.Pages.Add(tp_MVW);
                Props.TransitionMap.Pages.Add(tp_MediT);
                Props.TransitionMap.Pages.Add(tp_Google);
 
            #endregion

and everything works as it should. Now these three user controls, as you can see, are static files in the project with a physical path. All three of the controls have a WPF WebBrowser control. What happens when a user clicks a hyperlink in one of these browsers that opens has target=_blank and a new window opens. Well yes a new window opens OUTSIDE of the WPF application. No worries I added the needed hooks and now intercept that new window opening event. At this point what I want to do is create a new control with a WebBrowser on it and send it to the desired url. THEN I want to add it to the TransPages so it shows in the list of windows to transition between. My question is two fold. What method would you recommend for dynamically generating the user control (I have an idea about using ControlTemplate) and more importantly HOW would I add this "UserControl object" to the PageUri when it is expecting a physical path?
TIA
JB


that host a webbrowser. This loads great and all is well. Next the user clicks on a link and a new browser window opens outside of the wpf app. This makes sense since the wpf browser is just a wrapper and not a true WPF control. So I intercept the new window event and this is where it gets tricky. I want to load the page being opened in a new usercontrol's web browser control. In other words repeat the situation by which my app opens dynamically.

So I thought about creating a "NewWebPage" UserControl template. Great I could use it one time. The next click no more NewWebPage template as it has been used. (well technically I could reuse it but then the current page would be lost) What I would really like to do is use the NewWebPage template as a template. Would a DataTemplate be the way to go for this? If so how exactly as I've not used one in this way before.

Ramjet
Top achievements
Rank 1
 answered on 22 Aug 2011
1 answer
231 views
I'm not sure whether this should be posted in the RadTreeView forum, the RadDocking forum or in this forum, but here goes...

I have a RadTreeView control that lives inside a RadDocking pane. The treeview has a RadContextMenu associated with it, and if I right-click on a TreeViewItem while the rad pane is floating, the icons in the context menu disappear. Here is the markup that I am using for the TreeView:

<telerik:RadTreeView x:Name="tvProjectNav" Padding="0 0 10 0"
                            Background="White"
                            SelectionMode="Single"
                            ItemPrepared="TvProjectNavItemPrepared"
                            MouseDoubleClick="TvProjectNavMouseDoubleClick"
                            ExpanderStyle="{StaticResource Expander}"
                            telerik:TreeViewPanel.IsVirtualizing="True"
                            IsEditable="False">


                            <telerik:RadTreeViewItem
                                Header="{StaticResource navDiagramRootNodeText}"
                                ItemsSource="{Binding Source={StaticResource ProjectProvider},Path=Diagrams,UpdateSourceTrigger=PropertyChanged}"
                                ItemTemplate="{StaticResource DiagramItemTemplate}"/>


                            <telerik:RadTreeViewItem
                                Header="{StaticResource navTrendGroupsRootNodeText}"
                                ItemsSource="{Binding Source={StaticResource ProjectProvider},Path=TrendGroups,UpdateSourceTrigger=PropertyChanged}"
                                ItemTemplate="{StaticResource TrendGroupItemTemplate}" />


                            <telerik:RadContextMenu.ContextMenu>
                                <telerik:RadContextMenu x:Name="navContextMenu"
                                    Opened="NavContextMenuOpened"
                                    ItemClick="NavContextMenuItemClick"
                                    ItemTemplate="{StaticResource contextMenuItemTemplate}"/>
                            </telerik:RadContextMenu.ContextMenu>
                            
                           
                        </telerik:RadTreeView>

Can anyone tell me why the images disappear when the pane is floating?
Konstantina
Telerik team
 answered on 22 Aug 2011
1 answer
206 views
Hi Telerik,

We have the latest WPF library - as the project is progressing we have identified elements that we'd like to 'wrap' in busy indicator display.

When just adding the control, we are confronted with the need for code to be executed in background worker thread.

When code had been modified to be executed through the background worker, our code fails as the background thread modifies an ObservableCollection that a control relies on. .Net advices the use of Dispatcher.

However, if using the Dispatcher, I should 'go through' the control and ask it to modify the underlying collection - and that sort of violates the whole idea of MVVM.

I'm sure there's some brilliance hidden for me somewhere :) - can you enlighten me as to the recommended way of using BusyIndicator with MVVM?

Thanks,

Anders, Denmark.
Konstantina
Telerik team
 answered on 22 Aug 2011
1 answer
275 views
On this page, there is a note that states "If you use DataItemCollection as data source, the RadGridView will automatically synchronize the SortDescriptors of the source with its own ones." There is nothing describing how to instantiate a DataItemCollection, the constructor is internal, and there are very few examples of DataItemCollection ever being used, but it seems like it would help with my current scenario.

The reason for my wanting to use DataItemCollection came from a problem that I saw with maintaining selectability in the RadGridView. I have a class derived from ObservableCollection containing a property of type ListCollectionView, with SortDescriptions defined. The collection view is applied to the grid's ItemsSource. This is my problem scenario:
  1. I manually add a row to the grid view, through a button, by calling ListCollectionView.Add().
  2. I fill out the data in the cells and press enter.
  3. The CommitEdit() handling executes.
  4. Sorting is executed on the collection view.
    • On the ListCollectionView.CurrentChanging event, the collection view has its CurrentItem set to the edited row item.
    • On the ListCollectionView.CurrentChanged event, the collection view has its CurrentItem set to null!

I had tried creating a custom KeyboardCommandProvider, where I set only the CommitEdit and SelectCurrentItem commands, but that didn't make a difference (the commit still causes the unwanted chain of events).

This all works as intended if I remove the SortDescriptions from the collection view but I need them. How can I resolve this? Would using a DataItemCollection instead of a ListCollectionView help me in any way?

I am using Q1 of the WPF controls (version 2011.1.419.40).
Dimitrina
Telerik team
 answered on 22 Aug 2011
0 answers
71 views
Hi,

I want to know on how to show information about a date in the RadGridView when it is selected on the RadCalendar.  What I wanted to know is that when you click on a certain day on the RadCalendar, it will then appear on my RadGrid. Thanks.
Yana
Top achievements
Rank 1
 asked on 22 Aug 2011
1 answer
142 views
I am getting an error which appears to be similar to this one:
http://www.telerik.com/community/forums/wpf/general-discussions/system-web-assembly-error.aspx

I have a WPF app targeted to .NET 4 Client Profile, and it is referencing a view models namespace which is populating a BulletGraph QualitativeRangeCollection.  This project is referenced with  Telerik.Windows.Controls, .Controls.DataVisualization, and Windows.Data from RadControls for WPF Q2 2011.   On build I am getting this error:

The referenced assembly "C:\Development\DHS\DHSDashboardService\DHSDashboardViewModels\bin\DHSDashboardViewModels.dll" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.
Rossen Hristov
Telerik team
 answered on 22 Aug 2011
1 answer
130 views
Hi,
I have a page with RadRibbonBar at top and below RadDocking. Each Rad Ribbon bar tabs have few buttons like "View All", "Add new", "Edit Selected Item" & "Delete Selected Item".
When user press "View All" button, I create a new RadPane dynamically and add it to RadPaneGroup. Now I have following requirements to accomplish.
1. When user again press View All then just make then pane Docked and selected.
2. When user press Edit button and its relevant "View All Pane" is selected (i.e. has focus) then open a edit dialog. If its relevant "view all pane" is not selected (i.e. has focus) then don't do anything.
3. Same with Delete button as Edit button.

Now the problem is that if user Float the RadPane then it is removed form RadPaneGroup (i.e. its items count decreases) so I don't know how can I see that right now which RadPane has focus.
Kindly note that I am creating RadPane dynamically i.e. there is no fix number of RadPanes.
Kindly help me how can I do that?
Konstantina
Telerik team
 answered on 22 Aug 2011
1 answer
136 views
Hi all
I am using latest hotfix version of radcontrols. following error occured as i can not use radpane. how can i supress this error?

System.NullReferenceException was unhandled by user code
  Message=Object reference not set to an instance of an object.
  Source=Telerik.Windows.Controls.Docking
  StackTrace:
       at Telerik.Windows.Controls.RadDocking.SelectActivePane(RadPane radPane) in c:\TB\117\WPF_Scrum\Current_HotFix\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:line 332
       at Telerik.Windows.Controls.Docking.PaneGroupBase.OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e) in c:\TB\117\WPF_Scrum\Current_HotFix\Sources\Development\Controls\Docking\Docking\Parts\PaneGroupBase.cs:line 227
       at System.Windows.UIElement.OnGotKeyboardFocusThunk(Object sender, KeyboardFocusChangedEventArgs e)
       at System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
       at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
       at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
       at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
       at System.Windows.UIElement.Focus()
       at Telerik.Windows.Controls.Docking.PaneGroupBase.OnMouseLeftButtonDown(Object sender, RoutedEventArgs e) in c:\TB\117\WPF_Scrum\Current_HotFix\Sources\Development\Controls\Docking\Docking\Parts\PaneGroupBase.cs:line 392
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
  InnerException:
Konstantina
Telerik team
 answered on 22 Aug 2011
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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
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
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?