Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > DataForm > DataForm and DataTable

Not answered DataForm and DataTable

Feed from this thread
  • Aleks avatar

    Posted on Mar 26, 2012 (permalink)

    I am trying to bind the DataForm ItemsSource to a DataTable. Initially the DataForm is populated, but if I try to navigate through the records, I get an error.

    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
            }
        }
    }

    Reply

  • Ivan Ivanov Ivan Ivanov admin's avatar

    Posted on Mar 29, 2012 (permalink)

    Hi Aleks,

    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
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.
  • Simon avatar

    Posted on May 22, 2012 (permalink)

    Hello Ivan,

    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

    Reply

  • Ivan Ivanov Ivan Ivanov admin's avatar

    Posted on May 23, 2012 (permalink)

    Hello 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
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Simon avatar

    Posted on May 23, 2012 (permalink)

    Hello Ivan,

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

    Thanks,

    Simon

    Reply

  • Simon avatar

    Posted on Jun 14, 2012 (permalink)

    Hello Ivan,

    Unfortunately, I have tried build number 2012.1.528.40 and am experiencing the same exception.

    Please advise,

    Many thanks,

    Simon
    Attached files

    Reply

  • Didie Didie admin's avatar

    Posted on Jun 15, 2012 (permalink)

    Hello 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 >>

    Reply

  • Joel Palmer avatar

    Posted on Dec 10, 2012 (permalink)

    Do you have a working example of this with a DataSet as the back end now that you have fixes in?   I'm on 2012 Q3.

    Reply

  • Didie Didie admin's avatar

    Posted on Dec 11, 2012 (permalink)

    Hi,

    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.
     

    Kind regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

    Reply

  • Joel Palmer avatar

    Posted on Dec 11, 2012 (permalink)

    What type of collection currently works?  I'd like to use this so I may just reload the tables into an object.  Does this work with a collection of dynamic objects?

    Reply

  • Ivan Ivanov Ivan Ivanov admin's avatar

    Posted on Dec 14, 2012 (permalink)

    Hello,

    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.

    Attached files

    Reply

  • Ivan Ivanov Ivan Ivanov admin's avatar

    Posted on Jan 23, 2013 (permalink)

    Hi,

    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.

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > DataForm > DataForm and DataTable