protected
void Grid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) {
//if IsertAnother button is clicked
if (e.CommandName == "InsertAnother") {
//insert and then set the grid to insert again to open up new item window
handleInsert(sender, e);
//if the event is not cancelled, set the grid in insert mode to insert another item and call rebind on the grid
if (!e.Canceled) {
Grid1.MasterTableView.IsItemInserted =
true;
Grid1.Rebind();
}
}
//if the user selected to do the insert
if (e.CommandName == RadGrid.InitInsertCommandName) {
e.Canceled =
true;
e.Item.OwnerTableView.InsertItem();
GridEditableItem insertedItem = e.Item.OwnerTableView.GetInsertItem();
//fidn the edit control id
String userEditControlId = GridEditFormItem.EditFormUserControlID;
//get the edit control
UserControl userEditControl = insertedItem.FindControl(userEditControlId) as UserControl;
//get the text box1
RadTextBox TxtBox = userEditControl.FindControl("TextBox1") as RadTextBox;
TxtBox.Text = "10";
}
}
Thank you,
Ana
.colInherit
{
color:inherit;
}
<div style="color:Red">
<telerik:RadNumericTextBox ID="RadTextBox1" runat="server" Label="Tester" LabelCssClass="colInherit" >
</telerik:RadNumericTextBox >
</div>
Thanks in advance...
Andy