RadMap refreshing shape layer in ajaxpanel

5 posts, 1 answers
  1. Matthew
    Matthew avatar
    7 posts
    Member since:
    Oct 2014

    Posted 23 May 2015 Link to this post

    Hi

     The problem I am having is that when I put a RadAjaxPanel around my RadMap a postback to update the RadClientDataSource needs to be clicked twice in order for the select  url to be called. It works fine if I remove the ajax panel. 

     

    <telerik:RadAjaxPanel runat="server">
      <telerik:RadTabStrip ID="connectionsTabStrip" runat="server" MultiPageID="connectionsMultiPage">
      <Tabs>
        <telerik:RadTab Text="Map" PageViewID="mapPageView" />
      </Tabs>
      </telerik:RadTabStrip>
                          
      <telerik:RadMultiPage ID="connectionsMultiPage" runat="server">
        <telerik:RadPageView ID="mapPageView" runat="server">
          <telerik:RadClientDataSource runat="server" ID="tripDataSource" AutoSync="true">
            <DataSource>
              <WebServiceDataSourceSettings ServiceType="GeoJSON" />
            </DataSource>
          </telerik:RadClientDataSource>
      
          <telerik:RadButton ID="button" runat="server" Text="View" OnClick="button_Click" />
          <telerik:RadMap runat="server" ID="tripMap">
            <LayersCollection>
              <telerik:MapLayer></telerik:MapLayer>
              <telerik:MapLayer Type="Shape" ClientDataSourceID="tripDataSource">                  
                <StyleSettings>
                  <StrokeSettings Color="#ffffff" Width="10" />
                </StyleSettings>
              </telerik:MapLayer>
            </LayersCollection>
            <DataBindings>
              <MarkerBinding
                DataShapeField="shape"
                DataTitleField="title"
                DataLocationLatitudeField="locationLatitude"
                DataLocationLongitudeField="locationLongitude"
                DataTooltipTemplateField="tooltipTemplate" />
              </DataBindings>
              <CenterSettings  Latitude="-32.962926"  Longitude="151.699727"/>
            </telerik:RadMap>
          </telerik:RadPageView>
        </telerik:RadMultiPage>
      </div>
      <uc1:ExceptionArea runat="server" ID="ExceptionArea" />
    </telerik:RadAjaxPanel>

    I have some code behind on the button click "button_Click"

    tripDataSource.DataSource.WebServiceDataSourceSettings.Select.Url = "/Data/GetJsonTrip.aspx";
    tripDataSource.DataBind();
     
    tripMap.DataSource = GetMarkers();
    tripMap.DataBind();
     

     If I put a break point in GetJsonTrip.aspx I can see it only gets called, on the first click, but does get called on every click after that.

     If I set WebServiceDataSourceSettings.Select.Url in a partial post back, why does the indicated URL not get called after the first postback?

     

    Thanks for any help

    Matt

     

     

     

     

  2. Matthew
    Matthew avatar
    7 posts
    Member since:
    Oct 2014

    Posted 23 May 2015 in reply to Matthew Link to this post

    Sorry I meant to say...

    If I put a break point in GetJsonTrip.aspx I can see it doesn't get called on the first click, but does get called on every click after that.

    Thanks
    Matt

     

     

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Matthew
    Matthew avatar
    7 posts
    Member since:
    Oct 2014

    Posted 23 May 2015 Link to this post

    Some further details.

     The GetJsonTrip.aspx is not called after the first postback. It is called after subsequent post backs but will be using the previous postbacks URL value.

    It seems to be something like, setting the Select.Url on the datasource in an onclick event is too late for the map to be updated, and its not until the next page load that it looks at the new URL.

  5. Answer
    Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 27 May 2015 Link to this post

    Hello Matthew,

    The described matter here is already discussed in a support ticket sent to us (ID 938403). If there are any further questions on the case, let us discuss them there.

    For anyone else, the suggested approach is to use the client-side API of RadClientDataSoure to either control and refresh data, or get the Kendo DataSource object to modify directly the widget empowering the control.

    Example:
    var kendoDataSource = $find("<%= RadClientDataSource1.ClientID %>").get_dataSourceObject();
     
    kendoDataSource.transport.options.read.url = "GetJsonTrip.aspx?t=77776666&sd=2015-05-23+00%3a00%3a00&ed=2015-05-24+00%3a00%3a00"
    kendoDataSource.read();

    Regards,
    Ianko
    Telerik
  6. Matthew
    Matthew avatar
    7 posts
    Member since:
    Oct 2014

    Posted 27 May 2015 in reply to Ianko Link to this post

    Thanks Lanko, this worked just fine.

    Cheers
    Matt

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017