Hi,
I have a child window where I put a simple XamWebGrid containing 3 TextColumns. I have an ObservableCollection named Person:
private string _firstname;
private string _lastname;
private string _phone;
public string FirstName
{
get { return _firstname; }
set
if (value != _firstname)
_firstname =
value;
onPropertyChanged(
this, "UserFirstName");
}
public string LastName
get { return _lastname; }
if (value != _lastname)
_lastname =
this, "UserLastName");
public string Phone
get { return _phone; }
if (value != _phone)
_phone =
this, "Phone");
public event PropertyChangedEventHandler PropertyChanged;
public void onPropertyChanged(object sender, string propertyName)
if (PropertyChanged != null)
PropertyChanged(
this, new PropertyChangedEventArgs(propertyName));
The following code is how I populate the data:
person.Add(
FirstName =
"Tom",
LastName =
"Jones",
Phone =
"1234"});
new Person()
"Karen",
"AAA",
"87645"});
grdPerson.ItemsSource = person;
Below is my Xaml code:
="Visible" >
>
/>
="False">
="Wrap" />
To view the upated phone data changed, I have this code:
var qry = from rec1 in person
select rec1;
foreach (var item in qry)
MessageBox.Show("first phone " + item.Phone);
When I tried to change the phone numbers on both records, only the first record gets changed but not on the second one. I noticed this only happen on the child window. Can anyone help on this? Thanks!
Thanks Nikolay. It worked.
I was able to reproduce the behaviour that you see.
You can call the ExitEditMode method of the XamWebGrid when the OK button is clicked. This will force the cells to exit edit mode and commit their values.
Regards
Hi Nikolay,
Did you have the chance to take a look? In my previous reply, I have attached the files for your review.
Thanks!
I have attached the zip file. I use 9.2.20092.2014 version - VS2008. Please let me know if you need anything else. Thanks!
I've tried to reproduce the issue using the code from your post but without success.
Could you attach a sample that reproduces the issue?
Also, what version and build of the product do you use (for example: 10.1.20101.2232)?