Welcome Guest Search | Active Topics | Sign In | Register

ChangedItem[] property Options
Laura
Posted: Thursday, May 6, 2010 1:07:36 PM
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 />");
}
}
eo_support
Posted: Thursday, May 6, 2010 1:18:45 PM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.