This is a migrated thread and some comments may be shown as answers.

Binding ObservableCollection to SqlGeospatialDataReader

3 Answers 103 Views
Map
This is a migrated thread and some comments may be shown as answers.
Rieni De Rijke
Top achievements
Rank 1
Rieni De Rijke asked on 19 Jan 2012, 08:04 AM

I’ve problems binding an ObservableCollection<ISpatial> SpatialPolyItemCollection as Source in SqlGeospatialDataReader.

Nothing shows up in the map.

ISpatial is an Interface for a class Spatial containing Wkt to represent the polygon.

<telerik:InformationLayer x:Name="spatialPolyLayer">

   <telerik:InformationLayer.Reader>

        <telerik:SqlGeospatialDataReader x:Name="GeoReader" PreviewReadCompleted="PreviewReadCompleted"

Source="{Binding SpatialPolyItemCollection}"  GeospatialPropertyName="Wkt"      ToolTipFormat="Navn">

                    </telerik:SqlGeospatialDataReader>

       </telerik:InformationLayer.Reader>

</telerik:InformationLayer>

I can make it work in code behind by adding GeoReader.Source = SpatialPolyItemCollection.

Any Ideas how I can make this binding work without the code behind line?

I know that my collection is valid because it works fine if I use the same collection inside a GridView

<telerik:RadGridView x:Name="gridGeometriView"   SelectionMode="Extended"

                                      ItemsSource="{Binding SpatialPolyItemCollection}" FrozenColumnCount="2" SelectionChanged="GridViewSelectionChanged"/>

3 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 23 Jan 2012, 04:07 PM
Hi,

Thank you for the feedback.
We were able to reproduce the problem. We created a PITS issue and our developers will fix it. You can track its status using the following link:
http://www.telerik.com/support/pits.aspx#/public/wpf/9424

Greetings,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Rieni De Rijke
Top achievements
Rank 1
answered on 08 May 2012, 01:58 PM

Continue last ex PIT 9424

I have a project (model-view) with an EmptyProvider.

I’m displaying 1 point in a ObservableCollection using Binding (this works now).

But when I start manipulating my collection an assert in Telerik.Windows.Controls.Map.SqlGeospatialDataReader.RefreshItems() is reached.

 

Steps to reproduce:

  1. Observablecollection has one WktDataRow object – the object is displayed in the map OK
  2. Observablecollection.Add another WktDataRow object – two objects are displayed in the map OK
  3. Observablecollection.Clear – assert

 

Or

  1. Observablecollection has one WktDataRow object – the object is displayed in the map OK
  2. Observablecollection.Add another WktDataRow object – two objects are displayed in the map OK
  3. Observablecollection.Add one more WktDataRow object - assert

 

0
Evgenia
Telerik team
answered on 11 May 2012, 12:38 PM
Hello Rieni,

 Thanks for the detailed steps. I tried to reproduce the erroneous behavior following them but to no avail. As you can see from our online demo we are adding many WktDataRow-s. I changed the code a little - I added the WktDataCollection.Clear() method after adding several elements in the observable collection and it behaved as expected - no assert was reached.
It seems that the problem is somewhere else, but it is hard for me to guess it without your source code. Could you please open a formal support thread and attach a stripped down runnable version of your project where this reproduces? This will help us investigate it and get back to you with our feedback based on the code.

Greetings,
Evgenia
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
Map
Asked by
Rieni De Rijke
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Rieni De Rijke
Top achievements
Rank 1
Evgenia
Telerik team
Share this question
or