or
protected void Page_Init(object sender, EventArgs e){ NumericTextBoxSetting numericSetting = new NumericTextBoxSetting(); numericSetting.Validation.IsRequired = false; numericSetting.BehaviorID = "numeric"; numericSetting.InitializeOnClient = true; RadInputManager1.InputSettings.Add(numericSetting); NumericTextBoxSetting _currencySetting = new NumericTextBoxSetting(); _currencySetting.BehaviorID = "currency"; _currencySetting.DecimalDigits = 2; _currencySetting.Type = NumericType.Currency; _currencySetting.Validation.IsRequired = false; _currencySetting.InitializeOnClient = true; RadInputManager1.InputSettings.Add(_currencySetting);}
And apply it like:
TextBox _txtTotal = (TextBox)e.Item.FindControl("txtTotal");
RadInputManager1.InputSettings[1].TargetControls.Add(new TargetInput(_txtTotal.UniqueID, true));
This works like a charm. I want to change the culture of the rendered controls based on selections that the user places on the screen. I can't do it on the Page_Init, however, because the data is not available at the time.
Is there a way to change the culture after I've used the Page_Init to build the controls?[09/05/2013 13:27:30][ERROR]: Message: Object reference not set to an instance of an object. Source: Telerik.Web.UI StackTrace: at Telerik.Web.UI.RadComboBox.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.ControlCollection.Add(Control child) at Telerik.Web.UI.GridPagerItem.InitializePagerItem(GridColumn[] columns) at Telerik.Web.UI.GridPagerItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) at Telerik.Web.UI.GridTableView.CreateTopPagerItem(Boolean useDataSource, GridColumn[] copiedColumnSet, Boolean isPagingEnabled, GridTHead thead) at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at Telerik.Web.UI.GridTableViewBase.get_Controls() at Telerik.Web.UI.GridTableView.GetGridTable() at Telerik.Web.UI.RadGrid.PrepareRowsVisibility(GridTableView view) at Telerik.Web.UI.RadGrid.PrepareItems() at Telerik.Web.UI.RadGrid.ControlPreRender() at Telerik.Web.UI.RadCompositeDataBoundControl.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)txtCaseNo.Text = string.Empty;this.IsFirstLoad = true;chkICAR.SelectedValue = "No";chk8D.SelectedValue = "No";chkReassignAccept.SelectedValue = "No";chkReassignReject.SelectedValue = "No";chkRevertActionItem.SelectedValue = "No";chkReopenCase.SelectedValue = "No";chkAutoRaise.SelectedValue = "No";chkActivateCase.SelectedValue = "No";ddlStatus.SelectedIndex = -1;ddlModule.SelectedIndex = -1;ddlFailureCategory.SelectedIndex = -1;ddlFailureSubCategory.SelectedIndex = -1;ddlCaseType.SelectedIndex = -1;ddlTechnology.SelectedIndex = -1;ddlOwnershipGroup.SelectedIndex = -1;ddlCondCaseNo.SelectedIndex = -1;ddlCondStatus.SelectedIndex = -1;ddlCondModule.SelectedIndex = -1;ddlCondFailureCategory.SelectedIndex = -1;ddlCondFailureSubCategory.SelectedIndex = -1;ddlCondCaseType.SelectedIndex = -1;ddlCondTech.SelectedIndex = -1;ddlCondOwnershipGroup.SelectedIndex = -1;ddlCondCaseICAR.SelectedIndex = -1;ddlCondCase8D.SelectedIndex = -1;ddlCondReassignAccept.SelectedIndex = -1;ddlCondReassignReject.SelectedIndex = -1;ddlCondRevertActionItem.SelectedIndex = -1;ddlCondReopenCase.SelectedIndex = -1;ddlCondAutoRaise.SelectedIndex = -1;ddlCondActivateCase.SelectedIndex = -1;txtCaseNo.Enabled = false;ddlStatus.Enabled = false;ddlModule.Enabled = false;ddlFailureCategory.Enabled = false;ddlFailureSubCategory.Enabled = false;ddlCaseType.Enabled = false;ddlTechnology.Enabled = false;ddlOwnershipGroup.Enabled = false;chkICAR.Enabled = false;chk8D.Enabled = false;chkReassignAccept.Enabled = false;chkReassignReject.Enabled = false;chkRevertActionItem.Enabled = false;chkReopenCase.Enabled = false;chkAutoRaise.Enabled = false;chkActivateCase.Enabled = false;RadGrid1.ID = "RadGrid1" RadGrid1.Width = Unit.Pixel(1500) RadGrid1.Height = Unit.Pixel(700) RadGrid1.MasterTableView.EditMode = GridEditMode.InPlace RadGrid1.EnableViewState = True RadGrid1.AllowPaging = True 'RadGrid1.AllowCustomPaging = True RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric RadGrid1.AutoGenerateColumns = False RadGrid1.ShowStatusBar = True RadGrid1.AllowSorting = True RadGrid1.AllowFilteringByColumn = True RadGrid1.MasterTableView.NoDetailRecordsText = "No records could be found." RadGrid1.MasterTableView.NoMasterRecordsText = "No records could be found." RadGrid1.MasterTableView.ShowHeadersWhenNoRecords = True RadGrid1.Skin = "WebBlue" RadGrid1.ClientSettings.ClientEvents.OnGridCreated = "GetGridObject" RadGrid1.ClientSettings.Scrolling.FrozenColumnsCount = 2 RadGrid1.ClientSettings.AllowColumnsReorder = True RadGrid1.ClientSettings.ColumnsReorderMethod = GridClientSettings.GridColumnsReorderMethod.Swap RadGrid1.ClientSettings.Selecting.AllowRowSelect = True RadGrid1.ClientSettings.Resizing.AllowColumnResize = True RadGrid1.ClientSettings.Scrolling.AllowScroll = True RadGrid1.ClientSettings.Scrolling.UseStaticHeaders = True RadGrid1.ClientSettings.Scrolling.SaveScrollPosition = True RadGrid1.ClientSettings.ClientEvents.OnFilterMenuShowing = "filterMenuShowing" RadGrid1.FilterMenu.OnClientShowing = "MenuShowing" RadGrid1.MasterTableView.EnableViewState = True RadGrid1.MasterTableView.EnableColumnsViewState = True RadGrid1.MasterTableView.PageSize = 50 RadGrid1.MasterTableView.AllowMultiColumnSorting = True RadGrid1.MasterTableView.DataKeyNames = New String() {"DetailID", "Day", "FoundGeographies", "SubZipCount"} If mSubCodesAvailable Then RadGrid1.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerBind RadGrid1.MasterTableView.HierarchyDefaultExpanded = True End If