or
function OwnerComboBox_OnLoad(sender, eventArgs) { InvoiceWebService.GetItemsByCompanyId(sessionStorage.CompanyId, OnItemsComplete); } function OnItemsComplete(result) { for (var i = 0; i < result.length; i++) { var item = new Telerik.Web.UI.RadComboBoxItem(); item.set_text(result[i].Items + ""); var grid = $find("ctl00_BodyContentPlaceHolder_grdInvoiceItems"); var masterTbl = grid.get_masterTableView(); var gridRow = masterTbl.get_dataItems()[0]; var comboBox = gridRow.findControl("ddlItems"); comboBox.get_items().add(item); } }I have a radgrid with one coulmn as DateTime. It has a date picker.
When adding a row to the grid how to make that DateTime field required?
I have the following code in ItenCreated event
Dim calb As Telerik.Web.UI.RadDatePicker = DirectCast(editItem(ColumnName).Controls(0), Telerik.Web.UI.RadDatePicker)
calb.ID = "DateValidated"
Dim rfvDt As New RequiredFieldValidator()
rfvDt.ID = "RequiredFieldValidator2"
rfvDt.ErrorMessage = " " + firstColumnName + " is Required "
rfvDt.ControlToValidate = "DateValidated"
editItem(ColumnName).Controls.Add(rfvDt)
It errors out.
protected void Page_Load(object sender, EventArgs e) {EBCRequest EBCRequest = new EBCRequest(); var dataSource = EBCRequest.GetValidEBCRequest((int)Region.DBB); if (dataSource.Count > 0) { this.RadScheduler2.DataSource = dataSource; this.RadScheduler2.DataBind(); foreach (RequestModel request in dataSource) { RadScheduler2.AppointmentDataBound +=
new AppointmentDataBoundEventHandler(RadScheduler2_AppointmentDataBound); } this.RadScheduler2.ReadOnly = true; this.RadScheduler2.Rebind(); } if (!IsPostBack) { this.lblUserName.Text = this.LoginUser.FullName; } } void RadScheduler2_AppointmentDataBound(object sender, SchedulerEventArgs e) { if (e.Appointment.Resources.GetResourceByType("EventType") != null) { switch (e.Appointment.Resources.GetResourceByType("EventType").Text) { case "Plant tour Catawba": e.Appointment.BackColor = System.Drawing.Color.Blue; break; case "Plant tour Claremont": e.Appointment.BackColor = System.Drawing.Color.Yellow; break; default: break; } } }
How can i go in RadScheduler2_AppointmentDataBound while debugging?
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server" > <AjaxSettings > <telerik:AjaxSetting AjaxControlID="RadDockLayout1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadDockZone1" LoadingPanelID="RadDRadAjaxLoadingPanel1ockZone1" /> <telerik:AjaxUpdatedControl ControlID="rwinProperties" LoadingPanelID="RadDRadAjaxLoadingPanel1ockZone1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="rwinProperties"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadDockZone1" LoadingPanelID="RadDRadAjaxLoadingPanel1ockZone1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings></telerik:RadAjaxManagerProxy><telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" Skin="Black" /> <telerik:RadDockLayout ID="RadDockLayout1" runat="server" Skin="Default" OnSaveDockLayout="RadDockLayout1_SaveDockLayout" OnLoadDockLayout="RadDockLayout1_LoadDockLayout" StoreLayoutInViewState="True"> <telerik:RadDockZone ID="RadDockZone1" runat="server" Height="1400px" Width="1100px" Skin="Black" Orientation="Horizontal"> </telerik:RadDockZone> </telerik:RadDockLayout> <asp:Label id="lbCurrentProperty" runat="server" visible="false" /> <telerik:RadWindowManager ID="RadWindowManager1" runat="server"> <Windows> <telerik:RadWindow ID="rwinProperties" runat="server" Title="Select Properties" Height="550px" Width="450px" Left="150px" ReloadOnShow="false" VisibleOnPageLoad="false" ShowContentDuringLoad="false" CssClass="RadWindow" Modal="true"> </telerik:RadWindow> </Windows> </telerik:RadWindowManager>Dim URL As String = "SelectProperties.aspx?SectionID=" + SectionID + "&SectionCount=" + SectionCount + "&SectionName=" + SectionNameDim script As String = "function f(){radopen(""" + URL + """,""rwinProperties"").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", Script, True)Sub DisplayProperties(ByVal SectionID As String, SectionCount As String, ByVal SectionName As String) Dim script As String = "Sys.Application.add_load(ShowSelectProperties(""" & SectionID & """,""" & SectionCount & """,""" & SectionName & """));" ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", Script, True)End Subfunction ShowSelectProperties(SectionID, SectionCount, SectionName) { radopen("SelectProperties.aspx?SectionID=" + SectionID + "&SectionCount=" + SectionCount + "&SectionName=" + SectionName, "rwinProperties");}