Rank: Member Groups: Member
Joined: 5/3/2010 Posts: 11
|
Hi there,
I am using the ItemChanged event handler and the ChangedItem[] property, and i wish to retrieve the data in all the cells that i've made changes to. Although the event has fired, the ChangedItem[] array displayed nothing as the length of it shows 0. So i was wondering if i am using this ChangedItem[] property. Following is how my code is set up to print the data. Thanks!!
<eo:Grid ID="Grid1"...onitemchanged="Grid1_ItemChanged">
protected void Grid1_ItemChanged(object sender, GridItemEventArgs e) { int gi = Grid1.ChangedItems.Length; //the length shows 0. for (int i = 0; i < gi; i++) //thererfore this doesn't get run. { Response.Write(Grid1.ChangedItems[i] + "<br />"); } }
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
I am not exactly sure why ChangedItems is empty in your case however you should not use ChangedItems inside ItemChanged event. ItemChanged event is fired once for every changed item. So if user has changed two items, then ItemChanged will be fired twice. Thus inside ItemChanged event you should only care about the item that the event is fire upon, which you can get through e.Item.
Thanks!
|