Telerik Forums
UI for WPF Forum
3 answers
79 views
Hi,

I'm new to developing and have downloaded a trial of the WPF controls.I am trying to follow an example explaining how to use the geocode features. I have tried a few different ways but i always get the same error  "Object reference not set to an instance of an object." when it tries to run the code
Me.geocodeProvider.GeocodeAsync(geocodeRequest)

here is my full code any help would be greatly appreciated.

XAML
<Window x:Class="MainWindow"
           Title="MainWindow" Height="480" Width="620">
 
    <telerik:RadMap x:Name="RadMap" Height="540" VerticalAlignment="Top" ZoomLevel="7" Center="53.7500, -1.8333" MouseLocationIndicatorVisibility="Visible" NavigationVisibility="Collapsed" MapMouseDoubleClick="radMap1_MapMouseDoubleClick" MouseDoubleClickMode="None">
        <telerik:RadMap.Provider>
            <telerik:BingMapProvider Mode="Aerial" IsLabelVisible="True"
           IsTileCachingEnabled="True"
           ApplicationId="MY BING MAPS KEY" />
         
            </telerik:RadMap.Provider>
 
        <telerik:InformationLayer x:Name="informationlayer">
       
            </telerik:InformationLayer>
             
 
            ></telerik:RadMap>   
         
   
 
</Window>


VB
Imports Telerik.Windows.Controls.Map
 
Partial Public Class MainWindow
    Dim geocodeProvider As BingGeocodeProvider
    Dim geocodeLocation As Location
 
    Public Sub New()
        InitializeComponent()
    End Sub
 
    Private Sub WindowLoaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
 
 
 
 
 
 
        ' Init geocode provider.
        geocodeProvider = New BingGeocodeProvider() With { _
         .ApplicationId = "MY BING MAPS KEY", _
         .MapControl = Me.radMap _
        }
        AddHandler Me.geocodeProvider.GeocodeCompleted, AddressOf Me.Provider_GeocodeCompleted
        ' Me.geocodeProvider.GeocodeCompleted += New EventHandler(Of GeocodeCompletedEventArgs)(AddressOf Provider_GeocodeCompleted)
    End Sub
 
 
    Private Sub BeginGeocodingRequest()
        Dim address As New Address() With { _
         .CountryRegion = "UK", _
         .PostalCode = "LS17 6HA" _
        }
 
        Dim geocodeRequest As New GeocodeRequest() With { _
         .Address = address _
        }
        Me.geocodeProvider.GeocodeAsync(geocodeRequest)
    End Sub
 
    Private Sub Provider_GeocodeCompleted(ByVal sender As Object, ByVal e As GeocodeCompletedEventArgs)
        Dim response As GeocodeResponse = e.Response
        If response.Results.Count > 0 Then
            Me.radMap.SetView(response.Results(0).BestView)
 
            ' Me.informationlayer.ItemsSource = response.Results(0).Locations
            Me.informationlayer.ItemsSource = response.Results(0).Locations
        End If
    End Sub
 
    Private Sub radMap1_MapMouseDoubleClick(ByVal sender As System.Object, ByVal eventArgs As Telerik.Windows.Controls.Map.MapMouseRoutedEventArgs)
        Dim address As New Address() With { _
                .CountryRegion = "UK", _
                .PostalCode = "LS17 6HA" _
               }
 
        Dim geocodeRequest As New GeocodeRequest() With { _
         .Address = address _
        }
        Me.geocodeProvider.GeocodeAsync(geocodeRequest)
    End Sub
End Class



Thanks :)
Lindell
Top achievements
Rank 1
 answered on 22 Feb 2012
1 answer
225 views
In the attached image, I need access to this property to control the height of the rows.
Dani
Telerik team
 answered on 22 Feb 2012
7 answers
335 views
If I bind a RadGridView to a ListCollectionView with a filter, and I chance a value in a Grid cell that causes the filter to return false for that row, I get an exception in the Grid cell.

Code to reproduce:

public class MyEntity : INotifyPropertyChanged
{
    private bool _myBool;
    public bool MyBool
    {
        get { return _myBool; }
        set
        {
            _myBool = value;
            PropertyChanged(this, new PropertyChangedEventArgs("MyBool"));
        }
    }
 
    public event PropertyChangedEventHandler PropertyChanged;
}

public partial class MainWindow
    {
        public MainWindow()
        {
            InitializeComponent();
            DataContext = this;
 
            MyEntities = new ObservableCollection<MyEntity> { new MyEntity(), new MyEntity(), new MyEntity() };
            MyCv = (ListCollectionView)CollectionViewSource.GetDefaultView(MyEntities);
            MyCv.Filter = MyBoolFilter;
        }
 
        public ObservableCollection<MyEntity> MyEntities { get; set; }
 
        public ListCollectionView MyCv { get; set; }
 
        private bool MyBoolFilter(object item)
        {
            return !((MyEntity)item).MyBool;
        }
    }

<Window x:Class="GridViewTest.MainWindow"
        Title="MainWindow" Height="350" Width="525">
 
    <telerik:RadGridView ItemsSource="{Binding MyCv}"/>
     
</Window>

Steps to reproduce:
1. check one of the checkboxes in the grid
2. move focus to somewhere else

I use version Q3 2011 SP1, .Net 4.0

Is there a way around this problem?


Erik
Top achievements
Rank 1
 answered on 22 Feb 2012
3 answers
223 views
Hi,

Is possible to drag tile item without clicking the header? I need to drag the tile by clicking in the tile, and moving around holding the mouse button. The idea is to use this in a touch screen and I want the user clicking in the tile instead of the header. How can I do that?

Best regards,
Gonçalo Martins
Petar Mladenov
Telerik team
 answered on 22 Feb 2012
2 answers
109 views
Is there a way to create a stacked 100% BarSeries in a ChartView?
Ben
Top achievements
Rank 1
 answered on 22 Feb 2012
0 answers
62 views
Hi @ All,

i have a checkbox in each row. But just in one row it is allowed to set the checkbox true. Is there a easy way to do that?

Thanks
ww

ITA
Top achievements
Rank 1
 asked on 22 Feb 2012
1 answer
152 views
TextBoxRibbonUI localization doesn't work  but same localization is working in radribbinbar which was the previous version in wpf controls.
Tina Stancheva
Telerik team
 answered on 22 Feb 2012
1 answer
116 views
Hi,

I am using WCF data service to fetch spatial objects (polygon) from SQL Server database and render them on the information layer.Everything was working fine until I decided to have my calls Asynchronous, in which I have a callback method to assign my polygon list to a bind-enabled property on my ViewModel (PRISM).My view used to be slow and would hange due to both the synchronous WCF call and the bing provider assignment which seems to freeze the UI. Now my WCF call is Asynchronous and does not freeze the UI, but the bing provider assignment is still freezing the view for about 2 to 3 seconds.Is there any plan to change this provider effects on the UI ?

Thanks

Madani
Andrey
Telerik team
 answered on 22 Feb 2012
5 answers
333 views
I've got a RadSplitContainer that contains three RadPaneGroup each with one RadPane. On a certain event, I want to "shrink" one of the RadPanes. Changing the RadPage height or maxheight didn't seen to make a difference but changing the parent RadPaneGroup does. 

So in my code right now, on one click event when I want my RadPane to shrink, I change the RadPaneGroup's MaxHeight to 50. When I want it to expand again, I change the RadPaneGroup's MaxHeight back to PositiveInifinity. This works well but as soon as I change the height of the RadPaneGroup itself by grabbing the little separator between each RadPaneGroup with my mouse and dragging it; when my collapse event fires, the RadPaneGroup gets shrunk too much or not enough depending on whether I changed the height to be bigger or smaller than before.

It appears the value I set the MaxHeight to needs to change dynamically depending on the current ActualHeight of the RadPaneGroup but I can't seem to find at what factor this needs to change by or, more baffling, why it appears to be opposite depending on the way I changed the height of the RadPaneGroup (for example, if I make it bigger, I have to use a smaller number for the MaxHeight).

So first off, am I doing this wrong by playing with the MaxHeight? If not, how can I get this control whether it be the parent RadSplitContainer or the individual RadPaneGroups to change their height from/to a specific value and from/to infinity (fill)?

EDIT: I've also found that when I "shrink" the middle RadPaneGroup, it doesn't work the first time... then I expand it and shrink it again and, while it works, there is a large gap between it and the top RadPaneGroup.
Konstantina
Telerik team
 answered on 22 Feb 2012
1 answer
118 views
I've run into some somewhat strange behavior.

As I hover over items, the item gets highlighted in yellow. But if I then switch to navigating with the keyboard, the highlighted item is still shown, and now it's confusing as to which highlight is indicating the selection.

Is this expected behavior, and is there a way to control it?
Vera
Telerik team
 answered on 22 Feb 2012
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?