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

[Solved] Custom EditFormTemplate not working

3 Answers 151 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Albert
Top achievements
Rank 1
Albert asked on 21 May 2009, 06:50 AM
On the insertcommand, the e.Item is a GridDataItem instead of being GridEditFormInsertItem. Can someone help me.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 May 2009, 07:58 AM
Hello Albert,

How are you trying to fire the insert command? If you are trying to fire the insert on clicking a button in the row then you can try out teh following code to access editforminsertitem as shown below:
c#:
 protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
    { 
        if (e.CommandName == "Insert"
        { 
            GridEditFormInsertItem insertitem = (GridEditFormInsertItem)RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem)[0]; 
               
            TextBox txtbox = (TextBox)insertitem.FindControl("txtEdit"); 
        } 
    } 

Thanks
Princy.
0
Daniel
Telerik team
answered on 21 May 2009, 08:08 AM
Hello Albert,

You can access the EditItem on InsertCommand using the following approach:
(e.Item as GridDataItem).EditFormItem 

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Albert
Top achievements
Rank 1
answered on 21 May 2009, 08:24 AM
Thanks, I now can see the controls. But they have no text in the Text property. The .Text are blanks :(
Tags
Grid
Asked by
Albert
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Daniel
Telerik team
Albert
Top achievements
Rank 1
Share this question
or