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

The call is ambiguous between the folllowing methods or properties:

5 Answers 140 Views
Persistence Framework
This is a migrated thread and some comments may be shown as answers.
Gyan
Top achievements
Rank 1
Gyan asked on 31 Dec 2013, 05:02 PM
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

5 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 03 Jan 2014, 09:56 AM
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.
0
Gyan
Top achievements
Rank 1
answered on 15 Jan 2014, 10:15 AM
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.
0
Daniel
Telerik team
answered on 20 Jan 2014, 09:08 AM
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.
0
Naval
Top achievements
Rank 1
answered on 19 Jan 2017, 06:52 AM
I am also getting this error... any update on this.
0
Vessy
Telerik team
answered on 23 Jan 2017, 05:31 PM
Hi Naval,

I am afraid that we were never able to reproduce this problem nor examine what is causing it. Can you send us a runnable sample project where this behavior can be observed? Can you replicate it with the latest version of the controls (2017.1.118)?

Regards,
Vessy
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Persistence Framework
Asked by
Gyan
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Gyan
Top achievements
Rank 1
Naval
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or