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

Gridview with xmldataprovider issues

11 Answers 137 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Afsal
Top achievements
Rank 1
Afsal asked on 09 Feb 2011, 11:52 AM
After upgrading to latest version of telerik my gridview is throwing as error. Its datsource is set by using xmldaraprovider.
Please help me. With the previous version it was working fine.

11 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 09 Feb 2011, 12:25 PM
Hello,

 I'm not sure what't the error however our demo is working as expected. You can check it here:
http://demos.telerik.com/wpf/?GridView/WPF/DataSources

Greetings,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Afsal
Top achievements
Rank 1
answered on 09 Feb 2011, 01:44 PM
I am getting the following exception:
Object of type 'System.Func`2[System.Xml.XmlNode,System.String]' cannot be converted to type 'System.Func`2[System.Xml.XmlElement,System.String]'.


my code is:

 

 

Dim provider As New XmlDataProvider()
provider.IsAsynchronous =
False
provider.Source = New Uri(xmlfilePath, UriKind.RelativeOrAbsolute)
provider.XPath =
"Accounts/Sheets2"
Return New ObservableCollection(Of XmlNode)(DirectCast(provider.Data, IEnumerable(Of XmlNode)))

still getting the error. please help me.

thanks

 

0
Vlad
Telerik team
answered on 09 Feb 2011, 02:17 PM
Hello,

 Can you clarify if this stack trace is from some of our assemblies? 

All the best,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Afsal
Top achievements
Rank 1
answered on 09 Feb 2011, 02:27 PM

I did a sample application and the same issue is there :(
MainWindow.xaml:

 

<

 

 

Window x:Class="MainWindow" xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

 

 

xmlns:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" xmlns:RadGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" xmlns:RadGridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView" Title="MainWindow" Height="350" Width="525"><Grid>

 

 

 

 

<RadGrid:RadGridView x:Name="GrdList" AutoGenerateColumns="True" MaxHeight="600" MinWidth="650" BorderThickness="2" ></RadGrid:RadGridView></Grid></Window>

 

 

 

 

MainWindow.xaml.vb

 

 

 

Public Sub New()
InitializeComponent()
GrdList.ItemsSource = GetXmlData()
End Sub
Private Shared Function GetXmlData() As Object
Dim doc As New XmlDocument()
doc.LoadXml(
"<?xml version=""1.0"" encoding=""utf-8"" ?>" & vbCr & vbLf & "<Products>" & vbCr & vbLf & " <Product>" & vbCr & vbLf & " <ID>1</ID>" & vbCr & vbLf & " <Name>ASP.NET</Name>" & vbCr & vbLf & " <Url>http://www.telerik.com/products/aspnet-ajax.aspx</Url>" & vbCr & vbLf & " </Product>" & vbCr & vbLf & " <Product>" & vbCr & vbLf & " <ID>2</ID>" & vbCr & vbLf & " <Name>WinForms</Name>" & vbCr & vbLf & " <Url>http://www.telerik.com/products/winforms.aspx</Url>" & vbCr & vbLf & " </Product>" & vbCr & vbLf & " <Product>" & vbCr & vbLf & " <ID>3</ID>" & vbCr & vbLf & " <Name>Silverlight</Name>" & vbCr & vbLf & " <Url>http://www.telerik.com/products/silverlight.aspx</Url>" & vbCr & vbLf & " </Product>" & vbCr & vbLf & " <Product>" & vbCr & vbLf & " <ID>4</ID>" & vbCr & vbLf & " <Name>WPF</Name>" & vbCr & vbLf & " <Url>http://www.telerik.com/products/wpf.aspx</Url>" & vbCr & vbLf & " </Product>" & vbCr & vbLf & " <Product>" & vbCr & vbLf & " <ID>5</ID>" & vbCr & vbLf & " <Name>Reporting</Name>" & vbCr & vbLf & " <Url>http://www.telerik.com/products/reporting.aspx</Url>" & vbCr & vbLf & " </Product>" & vbCr & vbLf & " <Product>" & vbCr & vbLf & " <ID>6</ID>" & vbCr & vbLf & " <Name>Sitefinity ASP.NET CMS</Name>" & vbCr & vbLf & " <Url>http://www.telerik.com/products/sitefinity.aspx</Url>" & vbCr & vbLf & " </Product>" & vbCr & vbLf & " <Product>" & vbCr & vbLf & " <ID>7</ID>" & vbCr & vbLf & " <Name>OpenAccess ORM</Name>" & vbCr & vbLf & " <Url>http://www.telerik.com/products/orm.aspx</Url>" & vbCr & vbLf & " </Product>" & vbCr & vbLf & "</Products>" & vbCr & vbLf)
Dim provider As New XmlDataProvider()
provider.IsAsynchronous =
False
provider.Document = doc
provider.XPath =
"Products/Product"
Return New ObservableCollection(Of XmlNode)(DirectCast(provider.Data, IEnumerable(Of XmlNode)))
End Function

 

 

 

 

0
Vlad
Telerik team
answered on 09 Feb 2011, 02:33 PM
Hi,

 Can you bind the same to regular ListBox?

Regards,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Afsal
Top achievements
Rank 1
answered on 09 Feb 2011, 02:50 PM
Using listbox it is working fine.
this is the code i used:
MainWindow.xaml:
<ListBox x:Name="lstTest">
</ListBox>
MainWindow.xaml.vb:
lstTest.ItemsSource = GetXmlData()

 

0
Vlad
Telerik team
answered on 09 Feb 2011, 03:04 PM
Hello,

 I've just checked this with our latest official service pack (Q3 2010 SP1) and our latest internal build however everything worked fine. You can check the attached application for reference. 

All the best,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Afsal
Top achievements
Rank 1
answered on 09 Feb 2011, 03:17 PM
We are using donet framework version 3.5. The sample you gave me is using 4.0 . Could you please send me a sample in donet framework version 3.5.

--Thanks
0
Afsal
Top achievements
Rank 1
answered on 09 Feb 2011, 03:44 PM
FYI: the version i am using is : 2010.3.1314.35.

Please help me...

--thanks
0
Afsal
Top achievements
Rank 1
answered on 10 Feb 2011, 08:43 AM
Please let me know if there any fix for this issue as soon as possible.
0
Stefan Dobrev
Telerik team
answered on 10 Feb 2011, 10:39 AM
Hello Afsal,

We were able to reproduce your issue when we have retargeted the example to use .NET 3.5 . We will implement a fix for this in one of our next latest internal builds.

Thanks for pointing out this issue. I have updated your Telerik points respectively. I have also created a PITS item (#4815) for you in order to track the status of this bug.

Greetings,
Stefan Dobrev
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
Afsal
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Afsal
Top achievements
Rank 1
Stefan Dobrev
Telerik team
Share this question
or