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

[Solved] Get the insertForm from a RadGrid

1 Answer 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
IT Support
Top achievements
Rank 1
IT Support asked on 14 Jan 2010, 10:12 AM
Hi,

I have a RadGrid, and I know the InsertForm is opened (RadGrid1.MasterTableView.IsItemInserted == true).

How can I now get the InsertForm? This code is not executed inside a RadGrid event call, so I do not have any eventargs to get the inserted item or InsertForm from... 
I need a control on the current insertForm, and MasterTableView.Findcontrol() does not work...

Kind Regards,
Raymond

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 14 Jan 2010, 11:02 AM
Hello Raymond,

You can try the following code snippet in order to access the insertform and hence the control in insertform.

cs:
 
    protected void Button6_Click(object sender, EventArgs e) 
    { 
        RadGrid1.MasterTableView.IsItemInserted = true
        RadGrid1.MasterTableView.Rebind(); 
        GridEditFormInsertItem insertItem = (GridEditFormInsertItem)RadGrid1.MasterTableView.GetInsertItem(); 
        RadDatePicker RadDatePkr = (RadDatePicker)insertItem.FindControl("RadDatePicker2");  // Here RadDatePicker2 is placed in InsertForm 
    } 

-Shinu.
Tags
Grid
Asked by
IT Support
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or