Telerik Forums
UI for WPF Forum
1 answer
85 views
Is there any way to hover over map shapes and change the color of the underlying (state, country,...)?

Thanks for a quick answer.
Andrey
Telerik team
 answered on 22 Aug 2011
1 answer
338 views
I have looked through all of the samples, including the samples on this forum and I am just not understanding how to bind a collection of custom push pins using the MVVM paradigm. I understand the InformationLayer is an items control, so I should be able to bind anything to it, but it's just not working for me.

Consider a simple class like the following:

public class Address
{
    public Location Location { get; set; }
    public string Address { get; set; }
    public string City { get; set; }
    public string State { get; set; }
    public string Zip { get; set; }
}

I'd like to be able to add a pin to the map for each Address. My intent is to eventually provide hover functionality so that a popup displays information over the pin when the mouse hovers over it, but I haven't gotten the pins to display. In the view model, I have a property of type ObservableCollection<Address>. I then bind to the address collection in the XAML with the following:

<telerik:InformationLayer ItemsSource="{Binding AddressPins}" />

I understand I will have to create an item template in order to achieve the hover affect I'm looking for, but it is my understanding the above code should render pins for each location specified by an Address object. The following is an ICommand that handles the DragDropManager's OnDropInfo event (I'm dragging tasks onto the map).

if (e.Options.Status == DragStatus.DropComplete)
{
    RadMap map = (RadMap)e.Options.Destination;
    Location dropCursorLocation = Location.GetCoordinates(map, e.Options.RelativeDragPoint);
    Entity.Task task = (Entity.Task)e.Options.Payload;
    Address pin = new Address
        {
            Address = task.Address,
            City = task.City,
            Location = dropCursorLocation,
            State = task.State
            Zip = task.Zip
        };
 
    System.Diagnostics.Debug.WriteLine("Dropped at Latitude: {0} - Longitude: {1}", dropCursorLocation.Latitude, dropCursorLocation.Longitude);
 
    // Add pin to the map
    this.AddressPins.Add(pin);
 
    e.Handled = true;
}

If somebody could please further clarify how to handle this, I would greatly appreciate it. It should be noted I also tried having the Address class extend the Pushpin class, without success. I didn't think this was necessary, however, because the WPF samples were simple POCO's.
Andrey
Telerik team
 answered on 22 Aug 2011
1 answer
168 views
Hi,
How can I show legend on chart in RadChart?
I mean insted of showing values on pie ,show the title of that part.
for example if a pie has 3parts with values 10,20 and 30, it draws based on the values but show title of values instead of values itself
Peshito
Telerik team
 answered on 22 Aug 2011
1 answer
158 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
122 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
135 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
225 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
195 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
268 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
65 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
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?