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

The type 'DataRowView' does not contain a public property named 'UnitColumn'

7 Answers 215 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 08 Mar 2011, 11:35 AM
Hello,
I am running into the error: "The type 'DataRowView' does not contain a public property named 'UnitColumn'" error when trying to edit a cell in the radGridView cell.  I am dynamically creating a DataTable to bind to.  I have copied the xaml, along with the codebehind for a small sample that illustrates the issue. 
Thanks for your help!

Rob

 

 

<Window x:Class="GridSpike.TestWindow"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
        xmlns:local="clr-namespace:GridSpike"
        Title="ViewWindow" Height="400" Width="500">
    <Window.Resources>
        <local:TestViewModel x:Key="context" />
    </Window.Resources>
    <Grid DataContext="{StaticResource context}">
        <telerik:RadGridView 
                ItemsSource="{Binding GridDataView}"
                  
                Grid.Row="0"
                HorizontalAlignment="Stretch" 
                Margin="12,12,12,12" 
                VerticalAlignment="Top" 
                SelectionUnit="Cell" 
                x:Name="GridViewTest" 
                SelectionMode="Extended" FrozenColumnCount="1">
        </telerik:RadGridView>
    </Grid>
</Window>

 

 

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;
  
namespace GridSpike
{
    public class TestViewModel : INotifyPropertyChanged
    {
        public TestViewModel()
        {
            LoadGridDataTable();
        }
  
        private DataView gridDataView;
        public DataView GridDataView
        {
            get
            {
                if (gridDataView == null)
                    gridDataView = new DataView(gridDataTable);
  
                return gridDataView;
            }
        }
  
        private DataTable gridDataTable;
        public DataTable GridDataTable
        {
            get { return gridDataTable; }
            private set
            {
                gridDataTable = value;
                OnPropertyChanged("GridDataTable");
            }
        }
  
  
        private void LoadGridDataTable()
        {
            DataRow row;
            DataTable table = new DataTable();
            table.Columns.Add("UnitColumn", typeof(string));
            table.Columns.Add("01-2011", typeof(decimal));
            table.Columns.Add("02-2011", typeof(decimal));
  
            //Add test data
            for (int i = 0; i < 25; i++)
            {
                row = table.NewRow();
                row[0] = "Row " + i.ToString();
                row[1] = i;
                row[2] = 1 + 1;
                table.Rows.Add(row);
            }
            gridDataTable = table;
        }
  
        #region PropertyChanged Impl
        public event PropertyChangedEventHandler PropertyChanged;
        private void OnPropertyChanged(string property)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(property));
            }
        }
        #endregion
    }
}

7 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 08 Mar 2011, 12:36 PM
Hello,

 Can you post a bit more info where exactly you get this? Please post also the grid version. 

All the best,
Vlad
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Rob
Top achievements
Rank 1
answered on 08 Mar 2011, 12:57 PM
Hi Vlad,

The error occurs when I edit a cell:
1) Double-Click on a cell
2) Enter a value (that is consistent with the data type)
3) Exit the cell

The version of Telerik.Windows.Controls.GridView is: 2010.2.924.40.

Thanks!
0
Vlad
Telerik team
answered on 08 Mar 2011, 01:05 PM
Hi,

 Can you try our latest official version (Q3 2010 SP1) instead?

Regards,
Vlad
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Rob
Top achievements
Rank 1
answered on 08 Mar 2011, 01:12 PM
Is there a confirmed bug in the version I am working with?  The reason I ask is that I am working on a large project with many players.  There will be a cost associated with changing the component.

Rob
0
Yordanka
Telerik team
answered on 11 Mar 2011, 09:22 AM
Hello Rob,

We can confirm that we had this issue in Q2 2010 SP2 (version .0924). It was fixed in the first internal build after SP2 was released. The internal build version is .1001. 

Please, excuse us for the inconvenience caused.
 
Greetings,
Yordanka
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Rob
Top achievements
Rank 1
answered on 11 Mar 2011, 04:02 PM
How do we get access to that build?  We have a support contract.

Rob
0
Hristo
Telerik team
answered on 14 Mar 2011, 10:28 AM
Hi Rob,

Please, find attached the latest internal build for WPF with version 2010.2.1001.

If you need any further assistance do not hesitate to contact us again.

Kind regards,
Hristo
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
GridView
Asked by
Rob
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Rob
Top achievements
Rank 1
Yordanka
Telerik team
Hristo
Telerik team
Share this question
or