Binding ObservableCollection to SqlGeospatialDataReader

4 posts, 0 answers
  1. Rieni De Rijke
    Rieni De Rijke avatar
    170 posts
    Member since:
    Mar 2010

    Posted 19 Jan 2012 Link to this post

    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"/>

  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 23 Jan 2012 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Rieni De Rijke
    Rieni De Rijke avatar
    170 posts
    Member since:
    Mar 2010

    Posted 08 May 2012 Link to this post

    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

     

  5. Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 11 May 2012 Link to this post

    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 >>
Back to Top