Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi,

Actuallay I am using Telerik Testing Framework. In that i am taking normal datagrid Here i am facing one problem, When double click on particular row the control goes to "BeginningEdit" Event Handler, and then shows ""InValid Operation Exception" and editional infomation: "EditItem" is not allowed for this View". How can i overcome this problem and how edit is possible.
Posted
Comments
sudevsu 23-Mar-15 8:57am    
show your code to analyze the problem better.
Member 11527879 24-Mar-15 0:35am    
MainWindow.xaml.cs
------------------

using MVVM_WPFSample.ViewModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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;


namespace MVVM_WPFSample
{
///
/// Interaction logic for MainWindow.xaml
///

public partial class MainWindow : Window
{

private CustomerMainViewModel customerviewmodel=null;

public MainWindow()
{
InitializeComponent();
}

Country country = new Country();

public IList<country> Countries
{
get;
private set;
}



private void Window_Load(object sender, RoutedEventArgs e)
{
customerviewmodel = new CustomerMainViewModel();
//this.DataContext = customerviewmodel;

this.Countries = new Collection<country>()
{
new Country(){CountryName="India" ,
States = new Collection<states>()
{
new States(){ StateName = "AndhraPradesh" },
new States(){ StateName = "Bihar" },
new States(){ StateName = "Chandigarh" }
}},

new Country(){CountryName="USA" ,
States = new Collection<states>()
{
new States(){ StateName = "London" },
new States(){ StateName = "Birmingham" },
new States(){ StateName = "Glasgow" }
}},

new Country(){CountryName="Austraila" ,
States = new Collection<states>()
{
new States(){ StateName = "Sedney" },
new States(){ StateName = "Melbourn" },
new States(){ StateName = "Perth" }
}},

};
countryddl.ItemsSource = Countries;
//stateddl.ItemsSource = Countries[0].States;

}

private void Countries_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (countryddl.SelectedIndex == 0)
stateddl.ItemsSource = Countries[0].States;
if (countryddl.SelectedIndex == 1)
stateddl.ItemsSource = Countries[1].States;
if (countryddl.SelectedIndex == 2)
stateddl.ItemsSource = Countries[2].States;

}
List<customermainviewmodel> customer = new List<customermainviewmodel>();
private void Save_Click(object sender, RoutedEventArgs e)
{


customerviewmodel.NameTextField = tbName.Text;
customerviewmodel.AddressTextField = tbAddress.Text;
customerviewmodel.CountryField = countryddl.Text;
customerviewmodel.StateField = stateddl.Text;
customerviewmodel.Product = customerviewmodel.Product1 + "," + customerviewmodel.Product2;
customer.Add(customerviewmodel);
dataGrid1.Items.Add(customer);

MessageBox.Show("Data Successfully Saved", " MessageBox", MessageBoxButton.OK, MessageBoxImage.Asterisk);

clearValues();

}

private void MaleRadio_CheckedEvent(object sender, RoutedEventArgs e)
{
customerviewmodel.GenderField = "Male";
}

private void FemaleRadio_CheckedEvent(object sender, RoutedEventArgs e)
{
customerviewmodel.GenderField = "Female";
}




private void ProductTV_CheckedEvent(object sender, RoutedEventArgs e)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900