The call is ambiguous between the folllowing methods or properties:

4 posts, 0 answers
  1. Gyan
    Gyan avatar
    13 posts
    Member since:
    Nov 2012

    Posted 31 Dec 2013 Link to this post

    Hi

       I have a application in VS2010 in which I am using RadPersistenceManager but getting error when trying to save state of  RadGrid. I have attached Error and posting the code. Please help me....

    here is the asp code



    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication3.WebForm1" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <style type="text/css">
            .qsf-demo-canvas
            {
                background: url(bg_img.jpg) no-repeat;
                height: 441px;
                width: 476px;
            }
            .demo-canvas-inner
            {
                height: 100%;
                margin-left: -11px;
                padding-top: 26px;
            }
            
            .controls-container
            {
                clear: both;
                padding-top: 40px;
                zoom: 1;
            }
            .controls-container:after
            {
                content: "";
                clear: both;
                display: block;
            }
            .controls-container .rlbItem
            {
                height: 20px;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
            <telerik:RadPersistenceManager runat="server" ID="RadPersistenceManager1">
                <PersistenceSettings>
                    <telerik:PersistenceSetting ControlID="rgdemo" />
                </PersistenceSettings>
            </telerik:RadPersistenceManager>
            <asp:Label ID="Label1" runat="server" />
            <br />
            <div style="margin-left: 40px" class="qsf-ib">
                <telerik:RadButton ID="SaveButton" runat="server" Text="Save state" OnClick="SaveButton_Click"
                    Skin="Office2007" />
                <telerik:RadButton ID="ResetButton" runat="server" Text="Reset state" OnClick="ResetButton_Click"
                    Skin="Office2007" />
                <telerik:RadButton ID="LoadButton" runat="server" Text="Load state" OnClick="LoadButton_Click"
                    Enabled="false" Skin="Office2007" />
            </div>
            <div>
                <telerik:RadGrid runat="server" ID="rgdemo" EnableHeaderContextMenu="true" EnableHeaderContextAggregatesMenu="true"
                    Skin="Office2007" EnableHeaderContextFilterMenu="true">
                </telerik:RadGrid>
            </div>
            <asp:HiddenField runat="server" ID="SessionID" />
        </div>
        </form>
    </body>
    </html>
    ---------------------------------------------------Here is the codbehind-------------------




    Imports System.IO
    Imports Telerik.Web.UI

    Public Class WebForm1
        Inherits System.Web.UI.Page

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            
        End Sub
        Public Function GetData() As DataTable
            Dim table As New DataTable()
            table.Columns.Add("ID")
            table.Columns.Add("ParentID")
            table.Columns.Add("Value")
            table.Columns.Add("Text")

            table.Rows.Add(New [String]() {"1", Nothing, "World_Continents", "World Continents"})
            table.Rows.Add(New [String]() {"2", Nothing, "World_Oceans", "World Oceans"})

            table.Rows.Add(New [String]() {"3", "1", "Asia", "Asia"})
            table.Rows.Add(New [String]() {"4", "1", "Africa", "Africa"})
            table.Rows.Add(New [String]() {"5", "1", "Australia", "Australia"})
            table.Rows.Add(New [String]() {"6", "1", "Europe", "Europe"})
            table.Rows.Add(New [String]() {"7", "1", "North_America", "North America"})
            table.Rows.Add(New [String]() {"8", "1", "South_America", "South America"})

            table.Rows.Add(New [String]() {"9", "2", "Arctic_Ocean", "Arctic Ocean"})
            table.Rows.Add(New [String]() {"10", "2", "Atlantic_Ocean", "Atlantic Ocean"})
            table.Rows.Add(New [String]() {"11", "2", "Indian_Ocean", "Indian Ocean"})
            table.Rows.Add(New [String]() {"12", "2", "Pacific_Ocean", "Pacific Ocean"})
            table.Rows.Add(New [String]() {"13", "2", "South_Ocean", "SouthOcean"})

            Return table
        End Function

        Protected Sub SaveButton_Click(ByVal sender As Object, ByVal e As EventArgs)
            SessionID.Value = Guid.NewGuid().ToString()
            LoadButton.Enabled = True
            RadPersistenceManager1.StorageProviderKey = SessionID.Value
            RadPersistenceManager1.SaveState()
        End Sub

        Protected Sub LoadButton_Click(ByVal sender As Object, ByVal e As EventArgs)
            If File.Exists((Server.MapPath("~/App_Data") & "\") + SessionID.Value) Then
                RadPersistenceManager1.StorageProviderKey = SessionID.Value
                RadPersistenceManager1.LoadState()
            Else
                Label1.Text = "Please save some state before load it"
            End If
        End Sub
        Protected Sub ResetButton_Click(ByVal sender As Object, ByVal e As EventArgs)
         
        End Sub
        Protected Sub rgdemo_NeedDataSource(ByVal Sender As Object, ByVal e As GridNeedDataSourceEventArgs) Handles rgdemo.NeedDataSource
            rgdemo.DataSource = GetData()
        End Sub

    End Class
  2. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 03 Jan 2014 Link to this post

    Hello Gyan,

    Thank you for the runnable example. I'm not able to reproduce the problem however. Could you please provide step-by-step instructions? 

    Regards,
    Daniel
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Gyan
    Gyan avatar
    13 posts
    Member since:
    Nov 2012

    Posted 15 Jan 2014 Link to this post

    Hi Daniel,

    Thank you for your valuable reply.

     When I am trying to save the stale of grid and click on Save button then I am getting error "There was an error generating the XML document.". I am sending you screen shots step by step.

    Please find the attachment.


    thank you.
  5. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 20 Jan 2014 Link to this post

    Hello Gyan,

    Thanks for the screenshots. I'm sorry I'm unable to reproduce the issue locally. Please watch the attached video and then let me know if I'm missing something.

    Regards,
    Daniel
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top