Beispiel #1
0
        private void SetupInputManager(GridEditableItem editableItem)
        {
            // style and set URL column's textbox as required
            var textBox =
                ((GridTextBoxColumnEditor)editableItem.EditManager.GetColumnEditor("URL")).TextBoxControl;

            InputSetting inputSetting = RadInputManager1.GetSettingByBehaviorID("TextBoxSetting1");

            inputSetting.TargetControls.Add(new TargetInput(textBox.UniqueID, true));
            inputSetting.InitializeOnClient    = true;
            inputSetting.Validation.IsRequired = true;
        }
Beispiel #2
0
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem dataItem = (GridDataItem)e.Item;

                TextBox        txtBox        = (TextBox)dataItem.FindControl("txtBoxName");
                TextBoxSetting stringSetting = (TextBoxSetting)RadInputManager1.GetSettingByBehaviorID("StringBehavior");
                stringSetting.TargetControls.Add(new TargetInput(txtBox.UniqueID, true));

                txtBox = (TextBox)dataItem.FindControl("txtQuantityPerUnit");
                stringSetting.TargetControls.Add(new TargetInput(txtBox.UniqueID, true));

                txtBox = (TextBox)dataItem.FindControl("txtUnitPrice");
                NumericTextBoxSetting currencySetting = (NumericTextBoxSetting)RadInputManager1.GetSettingByBehaviorID("CurrencyBehavior");
                currencySetting.TargetControls.Add(new TargetInput(txtBox.UniqueID, true));

                txtBox = (TextBox)dataItem.FindControl("txtUnitsOnOrder");
                NumericTextBoxSetting numericSetting = (NumericTextBoxSetting)RadInputManager1.GetSettingByBehaviorID("NumberBehavior");
                numericSetting.TargetControls.Add(new TargetInput(txtBox.UniqueID, true));
            }
        }