using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
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 Page_Load(object sender, EventArgs e)
    {

    }
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            GridEditFormItem editedItem = e.Item as GridEditFormItem;
                      

            TextBox txt1 = editedItem.FindControl("TextBox1") as TextBox;
            DateInputSetting dateInputSetting = (DateInputSetting)RadInputManager1.GetSettingByBehaviorID("DateInputBehavior1");
            dateInputSetting.TargetControls.Clear();
            dateInputSetting.TargetControls.Add(new TargetInput(txt1.ID, true));

            TextBox txt2 = editedItem.FindControl("TextBox2") as TextBox;
            NumericTextBoxSetting numericSetting = (NumericTextBoxSetting)RadInputManager1.GetSettingByBehaviorID("NumericBehavior1");
            numericSetting.TargetControls.Clear();
            numericSetting.TargetControls.Add(new TargetInput(txt2.ID, true));

            TextBox txt3 = editedItem.FindControl("TextBox3") as TextBox;
            TextBoxSetting textBoxSetting = (TextBoxSetting)RadInputManager1.GetSettingByBehaviorID("TextBoxBehavior1");
            textBoxSetting.TargetControls.Clear();
            textBoxSetting.TargetControls.Add(new TargetInput(txt3.ID, true));

            TextBox txt4 = editedItem.FindControl("TextBox4") as TextBox;
            RegExpTextBoxSetting regExpSetting = (RegExpTextBoxSetting)RadInputManager1.GetSettingByBehaviorID("RegExpBehavior1");
            regExpSetting.TargetControls.Clear();
            regExpSetting.TargetControls.Add(new TargetInput(txt4.ID, true));
        }
    }
}
