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

[Solved] GridUpdatedEventArgs and obtaining changed value

2 Answers 154 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark DeMichele
Top achievements
Rank 1
Mark DeMichele asked on 26 Aug 2009, 11:52 PM
Hi there,

I've read in this forum that it's possible to obtain a value that the user changed on the Edit Form as follows:

            if ((e.Item is GridEditFormInsertItem) && (e.Item.OwnerTableView.IsItemInserted)) 
            { 
                GridEditFormInsertItem editformItem = (GridEditFormInsertItem)e.Item; 
                TextBox textBox = (TextBox)editformItem[columnName].Controls[0]; 
                return textBox.Text; 
            } 

But how would you do the same thing in the ItemUpdated handler?

There have been a few posts regarding obtaining a value from the grid in the ItemUpdated handler:

http://www.telerik.com/community/forums/aspnet-ajax/grid/get-item-name-from-grid.aspx

However, if the user modified the value, this method still returns the previous value.

Is there any way to obtain the value that the user entered in the TextBox from the GridUpdatedEventArgs instance?

Thanks,
Mark

2 Answers, 1 is accepted

Sort by
0
Accepted
Yavor
Telerik team
answered on 01 Sep 2009, 05:12 AM
Hi Mark,

You can use the same code, however, instead of using GridEditFormInsertItem, the item will be of type GridEditForm, or GridDataItem if you are using inplace editing. Other than this, the logic for accessing the cells remains the same.
I hope this information helps.

Kind regards,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Mark DeMichele
Top achievements
Rank 1
answered on 01 Sep 2009, 05:39 AM
Hmm. I thought I had tried that, but I guess I didn't. In any case, it works like a charm. Thanks!
Tags
Grid
Asked by
Mark DeMichele
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Mark DeMichele
Top achievements
Rank 1
Share this question
or