XML binding

Thread is closed for posting
2 posts, 0 answers
  1. Alex
    Alex avatar
    1 posts
    Member since:
    May 2011

    Posted 12 May 2011 Link to this post

    We are using the RAD chart and love it.  We are having a problem displaying XML data in non file format.  If we save the XML file the chart populates correctly, if we try using an object, we get :

     

    “There is no or empty series”

    Here is our code, any help would be appreciated:

    We have to bind RadChart.

    …..

    Dim resp As HttpWebResponse = DirectCast(req.GetResponse(), HttpWebResponse)

    Dim reader As New StreamReader(resp.GetResponseStream())

    Dim d As New XmlDocument()

    d.LoadXml(reader.ReadToEnd())

    reader.Close()

    d.Save(Server.MapPath("xmlFiles/Expense.xml"))

    RadChart1.DataSource = Server.MapPath("~/xmlFiles/Expense.xml")

    RadChart1.DataBind()

     

    This is works, but if I try to bind without save xml file (d.Save(Server.MapPath("xmlFiles/Expense.xml"))) :

    …..

    Dim resp As HttpWebResponse = DirectCast(req.GetResponse(), HttpWebResponse)

    Dim reader As New StreamReader(resp.GetResponseStream())

    Dim d As New XmlDocument()

    d.LoadXml(reader.ReadToEnd())

    reader.Close()

    RadChart1.DataSource = d.OuterXml

    RadChart1.DataBind()

  2. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 17 May 2011 Link to this post

    Hi Alex,
    In this case, you can use an XMLDataSource control. For example:
    XmlDataSource1.Data = d.OuterXml
     
    RadChart1.DataSourceID = XmlDataSource1.ID
    RadChart1.DataBind()

    For additional information on binding to XML using an XMLDataSource, please refer to our online documentation - http://www.telerik.com/help/aspnet-ajax/radchart-building-bind-xml-data-source-design-time.html.

    Regards,
    Tsvetie
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top