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

Accssesing butins in edit form Grid

3 Answers 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Cristian
Top achievements
Rank 1
Cristian asked on 26 Jan 2012, 04:43 PM
Hi I'm working with RadControls for ADP.NET AJAX 2011 Q1 and I have a radgrid with allowautomaticinserts and allowautomaticupdates set to true, When I click the addNewRecord a form is displayed where I have to insert the data.
My question is when I complete the form how can I access the confirm or cancel button in the "add new record form"?
The same case when I click on the  GridEditCommandColumn  the row change to editform. when I finish editing how can I confirm or cancel  the changes?
I'm using entity framework
                                                                      

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 Jan 2012, 05:31 AM
Hello Cristian,

You can access the buttons in ItemCreated event and customize accordingly.
C#:
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
 if (e.Item is GridEditableItem && e.Item.IsInEditMode  && e.Item.OwnerTableView.IsItemInserted)
 {
  LinkButton cancel = (LinkButton)e.Item.FindControl("CancelButton");
  cancel.Text = "Stop editing";
 }
}

-Shinu.
0
Cristian
Top achievements
Rank 1
answered on 27 Jan 2012, 05:11 PM
Hi Shinu.
I did it with RadGrid1_InsertCommand and RadGrid1_UpdateCommand.
Now the the buttons work fine but, how can I Insert/Update the values in the "Insert/Update form" within this events. 
0
Cristian
Top achievements
Rank 1
answered on 27 Jan 2012, 05:34 PM
Tags
Grid
Asked by
Cristian
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Cristian
Top achievements
Rank 1
Share this question
or