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

Get GridEditableItem for preinserted item

2 Answers 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan Dailey
Top achievements
Rank 1
Ryan Dailey asked on 03 Mar 2011, 10:40 PM
Hello,
I need to get to the GridItem for a record that I am inserting.  I'm actually changing the value of one of the controls in my EditItemTemplate.
Basically, the idea is the user performs some action while entering the information, and then through server-side code the value of a particular control gets changed.
But, I'm doing this outside the InsertCommand event, and can't figure out how to find it inside the RadGrid control.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 04 Mar 2011, 06:41 AM
Hello Ryan,

I guess you want to access the insert item from outside grid. If so you can try the following code snippet.

C#:
GridEditFormInsertItem insertItem = (GridEditFormInsertItem)RadGrid1.MasterTableView.GetInsertItem();
//if EditMode is 'EditForms/PopUp'
GridDataInsertItem insertItem = (GridDataInsertItem)RadGrid1.MasterTableView.GetInsertItem();
//if EditMode is 'InPlace'

Thanks,
Princy.
0
Ryan Dailey
Top achievements
Rank 1
answered on 04 Mar 2011, 08:17 PM
Great, that works.  Thanks!
Tags
Grid
Asked by
Ryan Dailey
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Ryan Dailey
Top achievements
Rank 1
Share this question
or