I have spent past hour searching for a solution, and I could not find any mention of this issue. DataForm works fine if binded to an ObservableCollection of business objects. But in this case I need it binded to a DataTable, and I cant seem to find a way to get it working.
IDE: VS2010
.Net Version: 4.0
Telerik Version: 2011.3.1220.40
I have created a sample project that recreates the same issue. The error that I receive when navigating through the records is:
The type 'DataRowView' does not contain a public property named 'DateTime'.
Parameter name: propertyName
<
Window
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
x:Class
=
"Testing.DataForm.MainWindow"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Grid
>
<
telerik:RadDataForm
Name
=
"dataForm"
/>
</
Grid
>
</
Window
>
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Windows;
using
System.Windows.Controls;
using
System.Windows.Data;
using
System.Windows.Documents;
using
System.Windows.Input;
using
System.Windows.Media;
using
System.Windows.Media.Imaging;
using
System.Windows.Navigation;
using
System.Windows.Shapes;
using
System.Data;
namespace
Testing.DataForm
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public
partial
class
MainWindow : Window
{
public
MainWindow()
{
InitializeComponent();
GenerateSomeData();
}
private
void
GenerateSomeData()
{
#region Data Generator
DataTable baseTable =
new
DataTable();
baseTable.Columns.Add(
"DateTime"
,
typeof
(DateTime));
baseTable.Columns.Add(
"Value"
,
typeof
(
decimal
));
DateTime date =
new
DateTime(DateTime.Now.Year, 11, 1);
TimeSpan span = date.AddMonths(1).AddDays(-1) - date;
int
numDays = span.Days;
int
randHigh = 65;
int
randLow = 0;
#region RANDOM DATA GENERATOR
Random rand =
new
Random();
int
calculatedNumHours = 24 * numDays;
for
(
int
hour = 1; hour <= calculatedNumHours; hour++)
{
baseTable.Rows.Add(
new
object
[]
{
date.AddHours(hour).AddSeconds(-1),
rand.NextDouble() * ((randHigh - randLow) + randLow)
});
}
#endregion
dataForm.ItemsSource = baseTable.DefaultView;
#endregion
}
}
}
15 Answers, 1 is accepted
Thank you for reporting this to us. We have recently stumbled upon a similar issue with RadDataForm when ItemsSource is bound to a DataTable. We will do our best to implement a fix in 2 weeks and include it in an internal build. I will keep in touch with you, in order to notify you as soon as the mentioned IB is released.
All the best,
Ivan Ivanov
the Telerik team

I am running into the same issue with the RadGridView being bound to a DataTable. I am using build 2012.1.0326.40 of the WPF controls.
Can you tell us when on in which build this issue will be fixed? Is there a bug report in your public bug tracker so that we can follow the progress?
Many thanks,
Simon
Would you please test this with our latest internal build - 2012.1.521 and tell us whether the problem persists on your side?
Kind regards,
Ivan Ivanov
the Telerik team

I will try the build as soon as I have a chance and will report on the result.
Thanks,
Simon

Unfortunately, I have tried build number 2012.1.528.40 and am experiencing the same exception.
Please advise,
Many thanks,
Simon
May I ask you to check what the behaviour is with the binaries from the latest release - Q2 2012? Would you please confirm if you use a code similar to the code posted when this thread was opened?
Regards,Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

We have a similar issue still logged into our system for fixing, so probably the issue was not fixed. We will re-evaluate the issue and hopefully we will be able to fix it.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

We will try to provide a fix for this issue in some of our future internal builds. As for the dynamics, RadDataForm supports them. I have prepared a very basic project to demonstrate.
All the best,Ivan Ivanov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
We have committed a fix for the logged issue. It will be available with the next internal build. I hope that it will solve your problem too.
All the best,Ivan Ivanov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

I have the recent version of Telerik controls purchased last week. I am trying to bind datatable with radgridview and raddataform. However, when I select particular row in the radgridview, the row is not changed/selected in the raddataform below. Is there any property that we need to set? I went through the demos but it does not show any example using datatable but only collectionview. I also need some fields to be comboboxes which is not possible by binding with datatable. Is there any example where we can convert the datatable into collectionview with classes having enums, etc. as shown in the demo?
You should set the RadGridView.ItemsSource/RadDataForm.ItemsSource to a DataTable.DefaultView.
Regards,Didie
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>

You should set the CurrentItem for the DataForm to be the SelectedItem in RadGridView. That way the selection for both the controls will be synchronized.
You can also check our online documentation here.
Didie
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>