Telerik Forums
UI for WPF Forum
1 answer
176 views
Hey there,

can anybody explain how to show the state and city names on the map when using the EmptyProvider?

I am not using the openstreetmap or bingprovider because I only want to show Asia on my map centered on the screen.
If I am using one of the providers above the map shows basically the entire earth and not only the shapes I have binded (Asia).

I am looking for a map that only shows Asia centered in the screen with its capital city names and states.

Thanks for any feedback.

Below you'll find my xaml....

 <telerik:RadMap x:Name="radMap" UseDefaultLayout="False">
            <telerik:RadMap.Providers>
                <telerik:EmptyProvider/>
                <!--<telerik:OpenStreetMapProvider/>-->
                <!--<telerik:BingMapProvider
                    ApplicationId="An5jY7yMdjU12_fZjI4evnJJ_Juwt38lr9TPdRK3UjaT2Uio-nKzl10K8jPnLnvT"
                    IsLabelVisible="True"/>-->
                
            </telerik:RadMap.Providers>

            <telerik:InformationLayer x:Name="shapeLayer" >
                <telerik:InformationLayer.Reader>
                    <telerik:MapShapeReader
                        DataSource="/DTClientServices.PlanningSuite.Views;component/Shapefiles/Asia/asia.dbf"
                        Source="/DTClientServices.PlanningSuite.Views;component/Shapefiles/Asia/asia.shp"/>
                </telerik:InformationLayer.Reader>
                <telerik:InformationLayer.ShapeFill>
                    <telerik:MapShapeFill Fill="#64D3D3D3" StrokeThickness="0"/>
                </telerik:InformationLayer.ShapeFill>
                <telerik:InformationLayer.HighlightFill>
                    <telerik:MapShapeFill Fill="#64FFC21C" StrokeThickness="0"/>
                </telerik:InformationLayer.HighlightFill>
                </telerik:InformationLayer>


                <telerik:InformationLayer x:Name="informationLayer" ItemsSource="{Binding MapData}" >
                    <telerik:InformationLayer.ItemTemplate>
                        <DataTemplate>
                            <Grid   telerik:MapLayer.BaseZoomLevel="{Binding BaseZoomLevel}"
                                    telerik:MapLayer.Location="{Binding Location}"
                                    telerik:MapLayer.ZoomRange="{Binding ZoomRange}">
                            <m:MapIconView Height="15" Width="15">
                                <ToolTipService.ToolTip>
                                    <ToolTip>

                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                            </Grid.RowDefinitions>

                                            <StackPanel Grid.Row="0">
                                                <TextBlock Grid.Row="0" FontWeight="Bold" Text="{Binding Caption,FallbackValue=Caption}"/>

                                                <Grid Margin="4">
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition />
                                                        <RowDefinition />
                                                        <RowDefinition />
                                                        <RowDefinition />
                                                        <RowDefinition />
                                                    </Grid.RowDefinitions>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition/>
                                                        <ColumnDefinition/>
                                                    </Grid.ColumnDefinitions>

                                                    <StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
                                                        <TextBlock Text="{Binding Measure1, FallbackValue=Measure1}"/>
                                                        <TextBlock Text=": "/>
                                                    </StackPanel>
                                                    <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Volume1, FallbackValue=Volume1}"/>

                                                    <StackPanel Grid.Row="1" Grid.Column="0"  Orientation="Horizontal">
                                                        <TextBlock Text="{Binding Measure2, FallbackValue=Measure2}"/>
                                                        <TextBlock Text=": "/>
                                                    </StackPanel>

                                                    <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Volume2, FallbackValue=Volume2}"/>

                                                    <Line Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Stretch="Fill" Stroke="LightGray" X2="1"/>

                                                    <TextBlock Grid.Row="3" Grid.Column="0">Rating:</TextBlock>
                                                    <Ellipse
                                                        Grid.Row="3"
                                                        Grid.Column="1"
                                                        Fill="Green"
                                                        Height="10"
                                                        Width="10" Margin="0,0,120,0" />
                                                    <TextBlock Grid.Row="4" Grid.Column="0">Status:</TextBlock>
                                                    <Ellipse
                                                        Grid.Row="4"
                                                        Grid.Column="1"
                                                        Fill="Red"
                                                        Height="10"
                                                        Width="10" Margin="0,0,120,0" />
                                                </Grid>
                                            </StackPanel>


                                        </Grid>
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                            </m:MapIconView>
                                <!--<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 23 Aug 2011
3 answers
233 views

Hi,

I am having some problems with RadTreeView.ExpandItemByPath(...). It does not do anything when I call it.

I guess the problem is that  I did not set headers for the listviewitems, but when I try to set it with the commented setter, the name does not get displayed.

Below you can see the (stripped) XAML for my ListView:

<telerik:RadTreeView ItemsSource="{Binding Items}">
                            
               <telerik:RadTreeView.ItemContainerStyle>
                   <Style TargetType="telerik:RadTreeViewItem">
                       <!--<Setter Property="Header" Value="{Binding Path=Item, Converter={StaticResource ClientTreeItemToTextConverter}}"/>-->
                       <Setter Property="IsDropAllowed" Value="{Binding IsDropAllowed, Mode=TwoWay}"/>
                       <Setter Property="IsLoadOnDemandEnabled" Value="{Binding IsLoadOnDemandEnabled, Mode=TwoWay}"/>
                       <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                       <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                    </Style>
               </telerik:RadTreeView.ItemContainerStyle>
 
               <telerik:RadTreeView.ItemTemplate>
                   <HierarchicalDataTemplate ItemsSource="{Binding Children}">
                       <StackPanel Orientation="Horizontal" Margin="2">
                           <Image Margin="0 0 4 0" Source="{Binding Path=Item.Type, Converter={StaticResource NodeTypeToImageConverter}}" VerticalAlignment="Center"/>
                           <TextBlock Text="{Binding Path=Item, Converter={StaticResource ClientTreeItemToTextConverter}}" VerticalAlignment="Center"/>
                       </StackPanel>
                   </HierarchicalDataTemplate>
               </telerik:RadTreeView.ItemTemplate>
 
          </telerik:RadTreeView>
Petar Mladenov
Telerik team
 answered on 23 Aug 2011
10 answers
485 views
Hi,

Could you please tell me what the best way to validating the form is? (and displaying error messages/highlighting fields)

Many thanks,
Daryl
Marcelo
Top achievements
Rank 1
 answered on 23 Aug 2011
11 answers
543 views

Hi

I posted that as a support ticket, but if you have an answer for me, feel frre to give it, thank you very much. I'll paste the answer form the support.


 

I am testing your product. I am trying to make a nested hierarchy inside a radGridView. My code is inspired from both the Getting started documentation and an example you gave about nested hierarchy. Please, see the attached project.

 

My goal is to show a list of Divisions in a gridView, each division has teams, and each team has some employees.

 

I have an Employee class:

 

    public class Employee

    {

        public string FirstName

        {

            get;

            set;

        }

        public string LastName

        {

            get;

            set;

        }

        public int Age

        {

            get;

            set;

        }

        public bool Married

        {

            get;

            set;

        }

 

    }

 

 

A team class who has a collection of employees:

 

public class Team

    {

        private ObservableCollection<Employee> _empl = new ObservableCollection<Employee>();

 

        public ObservableCollection<Employee> Empl

        {

            get

            { return _empl; }

 

            set

            { _empl = value; }

        }

 

 

        public int Ident

        {

            get;

            set;

        }

        public string Nom

        {

            get;

            set;

        }

        public int Place

        {

            get;

            set;

        }

 

    }

 

 

A division class who has a list of teams:

    public class Division

    {

        public int Id

        {

            get;

            set;

        }

        public string Name

        {

            get;

            set;

        }

        public List<Team> Teams

        {

            get;

            set;

        }

 

    }

 

And a DivisionService class, who creates a collection of divisions, populating each division with some teams and some teams with some employees. Here is an excerpt of the class:

 

   public class DivisionsService

    {

        public static ObservableCollection<Division> GetDivisions()

        {

ObservableCollection<Division> divisions = new ObservableCollection<Division>();

            Division dA = new Division();

            dA.Name = "Division A";

            dA.Id = 1;

            dA.Teams = new List<Team>();

            Team team1 = new Team();

            team1.Ident = 1;

            team1.Nom = "Team I";

            team1.Place = 1;

            Employee emp01 = new Employee();

            emp01.FirstName = "Maria";

            emp01.LastName = "Anders";

            emp01.Married = true;

            emp01.Age = 24;

            team1.Empl.Add(emp01);

            Employee emp02 = new Employee();

            emp02.FirstName = "Klodia";

            emp02.LastName = "Choufleur";

            emp02.Married = false;

            emp02.Age = 28;

            team1.Empl.Add(emp02);

            dA.Teams.Add(team1);

 

            Team team2 = new Team();

            team2.Ident = 2;

            team2.Nom = "Team II";

            team2.Place = 2;

            Employee emp03 = new Employee();

            emp03.FirstName = "Jean";

            emp03.LastName = "Bon";

            emp03.Married = true;

            emp03.Age = 44;

            team2.Empl.Add(emp03);

 

            dA.Teams.Add(team2);

 

          (code here)

           

           return divisions;

        }

    }

 

 

The XAML creates the gridview and the data template:

 

<Window x:Class="TestRadGridView.MainWindow"

                           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

                           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

                           xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

                           Title="MainWindow" Height="350" Width="525">

             <Grid>

        <telerik:RadGridView x:Name="HierarchicalGridView"

                             AutoGenerateColumns="False"

                             MinHeight="386">

 

 

 

            <telerik:RadGridView.Columns>

                <telerik:GridViewDataColumn DataMemberBinding="{Binding Id}"

                                       Header="Id" />

                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"

                                       Header="Name" />

            </telerik:RadGridView.Columns>

 

            <telerik:RadGridView.HierarchyChildTemplate>

                <DataTemplate>

                    <telerik:RadGridView

                        Name="teamGrid"

                        ShowGroupPanel="False"

                        AutoGenerateColumns="False">

                        <telerik:RadGridView.Columns>

                            <telerik:GridViewDataColumn

                                Header="Id"

                                DataMemberBinding="{Binding Ident}"/>

                            <telerik:GridViewDataColumn

                                Header="Nom"

                                DataMemberBinding="{Binding Nom}"/>

                            <telerik:GridViewDataColumn

                                Header="Place"

                                DataMemberBinding="{Binding Place}"/>

                        </telerik:RadGridView.Columns>

                        <telerik:RadGridView.HierarchyChildTemplate>

                            <DataTemplate>

                                <telerik:RadGridView

                                    Name="employeesGrid"

                                    ShowGroupPanel="False">

                                </telerik:RadGridView>

                            </DataTemplate>

                        </telerik:RadGridView.HierarchyChildTemplate>

                    </telerik:RadGridView>

                </DataTemplate>

            </telerik:RadGridView.HierarchyChildTemplate>

 

        </telerik:RadGridView>    

    </Grid>

</Window>

 

 

And the code behind the data binding and the relations:

 

       public MainWindow()

        {

            InitializeComponent();

 

            GridViewTableDefinition TeamsTableDefinition = new GridViewTableDefinition();

            TeamsTableDefinition.Relation = new PropertyRelation("Teams");

            this.HierarchicalGridView.TableDefinition.ChildTableDefinitions.Add(TeamsTableDefinition);

 

            GridViewTableDefinition emplTableDefinition = new GridViewTableDefinition();

            emplTableDefinition.Relation = new PropertyRelation("empl");

            TeamsTableDefinition.ChildTableDefinitions.Add(emplTableDefinition);

 

 

            this.HierarchicalGridView.ItemsSource = DivisionsService.GetDivisions();

 

        }

 

 

So, it does not work: I see the divisions, but there are no teams (and of course I can’t see is there are employees in the teams).

 

If I delete, in the XAML code, the data template, things are a little better: I see Teams in the divisions, but I do not see Employees in teams. Anyway, I need the data template.

 

So, what I did wrong?

 

 

Could-you too, please, say how to access a selected item in a nested grid? Thank you again.

 

Cordially

 

Richard

Richard
Top achievements
Rank 1
 answered on 23 Aug 2011
4 answers
974 views
Hi, I am prototyping with radgridview and am not very wpf experienced. I have a simple problem I can't solve and am hoping someone can give me a hint.

<telerik:RadGridView x:Name="Navigation"
                    AutoGenerateColumns="False"
                    ItemsSource="{StaticResource data}"
                    >

"data" is an ObservableCollection and I was expecting the grid to update, when the collection gets updated. Data already in the list after initialisation is shown. I guessed this does not work, as its a StaticResource, but with DynamicResource it also does not work.

However if i use c# code it works:

this.Navigation.ItemsSource = this.data;

Now its obvious to me I am doing something wrong with the ItemsSource in xaml, but I just have no clue what I should be doing...
marc
Top achievements
Rank 1
 answered on 23 Aug 2011
1 answer
121 views
Hi, How can I add the item template i create from the ResourceTypeTemplateSelector? 

All I wanted is that when  i click on a certain tab, a radgrid will appear. thanks
Tina Stancheva
Telerik team
 answered on 23 Aug 2011
1 answer
179 views
Hello,

We are currently using the gridview along with a chart control.  When a selection is made on the chart control, we select the cells in the gridview that are related (which amounts to all the cells in a particular column) and then use:


Grid1.ScrollIntoView(cell2Select, cell2Select.DataColumn);

 



We would like to expand this so that the selected column of cells moves directly underneath the selection made on the chart.  Is this possible?

Thanks,
Derek

Dimitrina
Telerik team
 answered on 23 Aug 2011
3 answers
120 views
Hey, on RadGridView with scrollbars and DragAndDrop query/info - when I try to scroll - Drag tooltip appears (OnDragQuery) preventing normal scrolling.

e.Options.Source is RadGridView, how to filter scrollbars out of DragDrop when scrolling content of RadGridView?

Thanks,
Alex
Tsvyatko
Telerik team
 answered on 23 Aug 2011
1 answer
135 views
Hello everybody

There is a standard way to set the maximum level of row nesting? For example two or three levels max.
I hope you can help me.

Best regards
Jorge
Dimitrina
Telerik team
 answered on 23 Aug 2011
1 answer
145 views
Hello,

Can you please attach/supply a simple example of a RadGrid having RadComboBox, RadButton on its cells/rows? Thanks!
I badly need it. Thank you!
Vera
Telerik team
 answered on 23 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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?