using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;

public partial class Default : System.Web.UI.Page 
{
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            GridDataItem editedItem = e.Item as GridDataItem;
            if (editedItem != null)
            {
                TextBox txt1 = editedItem["OrderDate"].Controls[0] as TextBox;
                DateInputSetting dateInputSetting = (DateInputSetting)RadInputManager1.GetSettingByBehaviorID("DateInputBehavior1");
                dateInputSetting.TargetControls.Add(new TargetInput(txt1.UniqueID, true));

                TextBox txt2 = editedItem["Freight"].Controls[0] as TextBox;
                NumericTextBoxSetting numericSetting = (NumericTextBoxSetting)RadInputManager1.GetSettingByBehaviorID("NumericBehavior1");
                numericSetting.TargetControls.Add(new TargetInput(txt2.UniqueID, true));

                TextBox txt3 = editedItem["ShipAddress"].Controls[0] as TextBox;
                TextBoxSetting textBoxSetting = (TextBoxSetting)RadInputManager1.GetSettingByBehaviorID("TextBoxBehavior1");
                textBoxSetting.TargetControls.Add(new TargetInput(txt3.UniqueID, true));

                TextBox txt4 = editedItem["ShipPostalCode"].Controls[0] as TextBox;
                RegExpTextBoxSetting regExpSetting = (RegExpTextBoxSetting)RadInputManager1.GetSettingByBehaviorID("RegExpBehavior1");
                regExpSetting.TargetControls.Add(new TargetInput(txt4.UniqueID, true));
            }
        }
    }
}
