DataSet
dsForScheduler = objDataLayer.GetDataSet("select * from ScheduleEvents");
RadScheduler1.DataSource = dsForScheduler;
RadScheduler1.DataKeyField =
"id";
RadScheduler1.DataSubjectField =
"Description";
RadScheduler1.DataStartField =
"DateFrom";
RadScheduler1.DataEndField =
"DateTo";
RadScheduler1.DataRecurrenceField =
"ReoccuranceRule";
RadScheduler1.DataRecurrenceParentKeyField =
"ReoccuranceID";
RadScheduler1.MinutesPerRow = 10;
RadScheduler1.TimeLabelRowSpan = 1;
RadScheduler1.DataBind();
----------------------------------------------------------------------------------------------------------------
Now when I insert a new Appointment, I am able to insert values into the scheduler, but...
when I make it a recurrent appointment, the data goes to the database, but I find that only the one appointment which I created is shown in the scheduler, I don't have the recurrence happening.
what has to be done to achieve this...
Kindly help at the earliest possible....
| <div id="myCoursesPage"> |
| <asp:PlaceHolder ID="phCatalog" runat="server" /> |
| </div> |
| public partial class modules_MyCourses_admin_ManageCurricula_ucShowCatalog : System.Web.UI.UserControl |
| { |
| CurriculaManager CM = new CurriculaManager(); |
| DataSet catalogDS = null; |
| HtmlGenericControl CatalogHeader = null; |
| HtmlGenericControl CatalogDiv = null; |
| GridControl currentGrid = null; |
| private bool _showUnassigned = true; |
| public bool ShowUnassigned |
| { |
| get |
| { |
| return _showUnassigned; |
| } |
| set |
| { |
| _showUnassigned = value; |
| } |
| } |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| this.Page.PreRenderComplete += new EventHandler(Page_PreRenderComplete); |
| if (catalogDS == null) |
| { |
| GetDataset(); |
| Session["CatalogGridSource"] = catalogDS; |
| } |
| LoadCatalog(catalogDS); |
| } |
| protected void Page_PreRenderComplete(object sender, EventArgs e) |
| { |
| foreach (Control ctrl in phCatalog.Controls) |
| { |
| foreach (Control ctrldiv in ctrl.Controls) |
| { |
| if (ctrldiv.ID.StartsWith("CatalogGrid_")) |
| { |
| RadGrid catalog = ctrldiv as RadGrid; |
| HideExpandColumnRecursive(catalog.MasterTableView); |
| } |
| } |
| } |
| } |
| public void GetDataset() |
| { |
| catalogDS = CM.ClassificationsGetCatalogList(((PortalPage)this.Page).UsePortalID, Convert.ToInt32(Session["UserID"]), 1); |
| } |
| protected void CatalogGrid_ColumnCreated(object sender, GridColumnCreatedEventArgs e) |
| { |
| if (e.Column is GridExpandColumn) |
| { |
| e.Column.Visible = false; |
| } |
| //else if (e.Column is GridBoundColumn) |
| //{ |
| // e.Column.HeaderStyle.Width = Unit.Pixel(100); |
| //} |
| if (e.Column is GridBoundColumn || e.Column is GridTemplateColumn) |
| { |
| e.Column.HeaderStyle.Width = Unit.Pixel(100); |
| } |
| } |
| private void CreateGrid(int CatalogID) |
| { |
| currentGrid = new GridControl(); |
| currentGrid.EnableEmbeddedSkins = false; |
| currentGrid.Skin = "Default"; |
| currentGrid.EnableViewState = false; |
| currentGrid.HorizontalAlign = HorizontalAlign.NotSet; |
| currentGrid.GridLines = GridLines.None; |
| currentGrid.ShowHeader = false; |
| currentGrid.AllowPaging = false; |
| currentGrid.ColumnCreated += new GridColumnCreatedEventHandler(CatalogGrid_ColumnCreated); |
| currentGrid.ID = "CatalogGrid_" + CatalogID; |
| currentGrid.MasterTableView.DataKeyNames = new string[2] { "CatalogID", "ParentClassificationID" }; |
| currentGrid.Width = Unit.Percentage(100); |
| currentGrid.AutoGenerateColumns = false; |
| currentGrid.GroupingEnabled = false; |
| currentGrid.ShowGroupPanel = false; |
| currentGrid.AllowSorting = true; |
| currentGrid.MasterTableView.HierarchyDefaultExpanded = true; |
| currentGrid.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerOnDemand; |
| currentGrid.MasterTableView.SelfHierarchySettings.KeyName = "CatalogID"; |
| currentGrid.MasterTableView.SelfHierarchySettings.ParentKeyName = "ParentClassificationID"; |
| currentGrid.MasterTableView.SelfHierarchySettings.MaximumDepth = 10; |
| currentGrid.MasterTableView.TableLayout = GridTableLayout.Fixed; |
| if (Assembly.GetAssembly(typeof(ScriptManager)).FullName.IndexOf("3.5") != -1) |
| { |
| currentGrid.MasterTableView.FilterExpression = @"it[""ParentClassificationID""] = " + CatalogID; |
| } |
| else |
| { |
| currentGrid.MasterTableView.FilterExpression = "ParentClassificationID = " + CatalogID; |
| } |
| currentGrid.ClientSettings.AllowExpandCollapse = true; |
| GridTemplateColumn templateColumn = new GridTemplateColumn(); |
| templateColumn.UniqueName = "CatalogName"; |
| templateColumn.ItemTemplate = new MyTemplate(templateColumn.UniqueName); |
| currentGrid.MasterTableView.Columns.Add(templateColumn); |
| currentGrid.ItemCreated += new GridItemEventHandler(CatalogGrid_ItemCreated); |
| currentGrid.ItemDataBound += new GridItemEventHandler(CatalogGrid_ItemDataBound); |
| currentGrid.NeedDataSource += new GridNeedDataSourceEventHandler(currentGrid_NeedDataSource); |
| } |
| private class MyTemplate : ITemplate |
| { |
| protected Button btExpandCollapse; |
| protected Image imClassification; |
| protected Label lbCatalogName; |
| protected HyperLink hyCurriculumName; |
| protected Literal ltShortDescription; |
| protected HtmlGenericControl divAround; |
| private string colname; |
| public MyTemplate(string cName) |
| { |
| colname = cName; |
| } |
| public void InstantiateIn(System.Web.UI.Control container) |
| { |
| btExpandCollapse = new Button(); |
| btExpandCollapse.ID = "btExpandCollapse"; |
| btExpandCollapse.CommandName = "ExpandCollapse"; |
| imClassification = new Image(); |
| imClassification.ID = "imClassification"; |
| imClassification.Visible = false; |
| lbCatalogName = new Label(); |
| lbCatalogName.ID = "lbCatalogName"; |
| hyCurriculumName = new HyperLink(); |
| hyCurriculumName.ID = "hyCurriculumName"; |
| ltShortDescription = new Literal(); |
| ltShortDescription.ID = "ltShortDescription"; |
| divAround = new HtmlGenericControl(); |
| divAround.ID = "divAround"; |
| divAround.Controls.Add(btExpandCollapse); |
| divAround.Controls.Add(imClassification); |
| divAround.Controls.Add(lbCatalogName); |
| divAround.Controls.Add(hyCurriculumName); |
| divAround.Controls.Add(ltShortDescription); |
| container.Controls.Add(divAround); |
| } |
| } |
| void currentGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e) |
| { |
| GridControl grid = (GridControl)source; |
| int ClassificationID = Convert.ToInt32(grid.ID.Substring(grid.ID.IndexOf("_") + 1)); |
| if (catalogDS == null) |
| { |
| GetDataset(); |
| Session["CatalogGridSource"] = catalogDS; |
| } |
| grid.DataSource = GetCatalogRows(catalogDS, ClassificationID); |
| } |
| private DataSet GetCatalogRows(DataSet ds, int CatalogID) |
| { |
| DataSet dsNew = new DataSet(); |
| dsNew.Tables.Add(ds.Tables[0].Clone()); |
| dsNew.Tables[0].Clear(); |
| DataRow[] rows = ds.Tables[0].Select("ParentClassificationID = " + CatalogID); |
| dsNew.Merge(rows); |
| foreach(DataRow row in rows) |
| { |
| dsNew.Merge(GetCatalogRows(ds, Convert.ToInt32(row["CatalogID"]))); |
| } |
| return dsNew; |
| } |
| public void HideExpandColumnRecursive(GridTableView tableView) |
| { |
| GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView); |
| foreach (GridNestedViewItem nestedViewItem in nestedViewItems) |
| { |
| foreach (GridTableView nestedView in nestedViewItem.NestedTableViews) |
| { |
| nestedView.Style["border"] = "0"; |
| Button MyExpandCollapseButton = (Button)nestedView.ParentItem.FindControl("btExpandCollapse"); |
| if (nestedView.Items.Count == 0) |
| { |
| if (MyExpandCollapseButton != null) |
| { |
| MyExpandCollapseButton.Style["visibility"] = "hidden"; |
| } |
| GridDataItem dataItem = (GridDataItem)nestedView.ParentItem; |
| TableCell cell = dataItem[dataItem.OwnerTableView.ExpandCollapseColumn.UniqueName]; |
| cell.Controls[0].Visible = false; |
| nestedViewItem.Visible = false; |
| } |
| else |
| { |
| if (MyExpandCollapseButton != null) |
| { |
| MyExpandCollapseButton.Style.Remove("visibility"); |
| } |
| } |
| if (nestedView.HasDetailTables) |
| { |
| HideExpandColumnRecursive(nestedView); |
| } |
| } |
| } |
| } |
| protected void CatalogGrid_ItemCreated(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridCommandItem) |
| { |
| e.Item.Style["display"] = "none"; |
| } |
| if (e.Item is GridHeaderItem) |
| { |
| //Hides the headers |
| e.Item.Style["display"] = "none"; |
| } |
| if (e.Item is GridNestedViewItem) |
| { |
| e.Item.Cells[0].Visible = false; |
| e.Item.Cells[0].Width = Unit.Pixel(150); |
| } |
| if (e.Item is GridNoRecordsItem) |
| { |
| e.Item.Style["display"] = "none"; |
| e.Item.OwnerTableView.Visible = false; |
| } |
| } |
| protected void CatalogGrid_ItemDataBound(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridDataItem) |
| { |
| string Path = Server.MapPath("~\\Portals\\" + ((PortalPage)this.Page).UsePortalID.ToString() + "\\img\\Catalog\\"); |
| GridDataItem gridDataItem = e.Item as GridDataItem; |
| Image imClassification = gridDataItem["CatalogName"].FindControl("imClassification") as Image; |
| Label lbCatalogName = gridDataItem["CatalogName"].FindControl("lbCatalogName") as Label; |
| HyperLink hyCurriculumName = gridDataItem["CatalogName"].FindControl("hyCurriculumName") as HyperLink; |
| if (Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "IsCurriculum").ToString()) == 1) |
| { |
| hyCurriculumName.Text = DataBinder.Eval(e.Item.DataItem, "CatalogName").ToString() + " (" + DataBinder.Eval(e.Item.DataItem, "NumCourses").ToString() + ")"; |
| hyCurriculumName.NavigateUrl = "~/modules/catalog/Package.aspx?CourseGroupID=" + DataBinder.Eval(e.Item.DataItem, "CatalogID").ToString(); |
| lbCatalogName.Visible = false; |
| } |
| else |
| { |
| lbCatalogName.Text = DataBinder.Eval(e.Item.DataItem, "CatalogName").ToString(); |
| hyCurriculumName.Visible = false; |
| } |
| if (DataBinder.Eval(e.Item.DataItem, "ImageName").ToString() != "") |
| { |
| imClassification.ImageUrl = Path + DataBinder.Eval(e.Item.DataItem, "ImageName").ToString(); |
| imClassification.Visible = true; |
| } |
| Literal ltShortDescription = gridDataItem["CatalogName"].FindControl("ltShortDescription") as Literal; |
| if (DataBinder.Eval(e.Item.DataItem, "ShortDescription").ToString() != "") |
| { |
| ltShortDescription.Text = "<p>" + DataBinder.Eval(e.Item.DataItem, "ShortDescription").ToString() + "</p>"; |
| } |
| else |
| { |
| ltShortDescription.Visible = false; |
| } |
| //Create Levels |
| Button btExpandCollapse = gridDataItem["CatalogName"].FindControl("btExpandCollapse") as Button; |
| btExpandCollapse.Click += new EventHandler(button_Click); |
| if (!IsPostBack) |
| { |
| btExpandCollapse.CssClass = (Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "ShowExpanded").ToString()) == 0) ? "rgCollapse" : "rgExpand"; |
| } |
| else |
| { |
| btExpandCollapse.CssClass = (e.Item.Expanded) ? "rgCollapse" : "rgExpand"; |
| } |
| btExpandCollapse.CssClass = (e.Item.Expanded) ? "rgCollapse" : "rgExpand"; |
| HtmlGenericControl divAround = gridDataItem["CatalogName"].FindControl("divAround") as HtmlGenericControl; |
| int level = (e.Item.ItemIndexHierarchical.Split(':').Length > 0 ? e.Item.ItemIndexHierarchical.Split(':').Length - 1 : e.Item.ItemIndexHierarchical.Split(':').Length); |
| if (level > 0) |
| { |
| divAround.Style["margin-left"] = (level * 20) + "px"; |
| } |
| //if (e.Item.OwnerTableView.HierarchyLoadMode == GridChildLoadMode.Client) |
| //{ |
| // string script = String.Format(@"$find(""{0}"")._toggleExpand(this, event); return false;", gridDataItem.Parent.Parent.ClientID); |
| // btExpandCollapse.OnClientClick = script; |
| //} |
| } |
| } |
| private void LoadCatalog(DataSet ds) |
| { |
| DataSet Catalogds = new DataSet(); |
| Catalogds.Tables.Add(ds.Tables[0].Clone()); |
| Catalogds.Tables[0].Clear(); |
| DataRow[] rows = null; |
| rows = ds.Tables[0].Select("ParentClassificationID IS NULL"); |
| foreach (DataRow row in rows) |
| { |
| Catalogds.Tables[0].ImportRow(row); |
| } |
| int prevClassificationID = -1; |
| for (int counter = 0; counter < Catalogds.Tables[0].Rows.Count; counter++) |
| { |
| DataRow row = Catalogds.Tables[0].Rows[counter]; |
| int ClassificationID = -1; |
| if (row["CatalogID"] != DBNull.Value) |
| { |
| ClassificationID = Convert.ToInt32(row["CatalogID"].ToString()); |
| } |
| if (ClassificationID != prevClassificationID) |
| { |
| CatalogDiv = new HtmlGenericControl("div"); |
| CatalogDiv.ID = "CatalogDiv" + row["CatalogID"].ToString(); |
| CatalogDiv.Attributes.Add("class", "root-catalog"); |
| CatalogHeader = new HtmlGenericControl("h2"); |
| CatalogHeader.ID = "CatalogHeader" + row["CatalogID"].ToString(); |
| CatalogHeader.InnerText = row["CatalogName"].ToString(); |
| CatalogDiv.Controls.Add(CatalogHeader); |
| prevClassificationID = ClassificationID; |
| } |
| CreateGrid(ClassificationID); |
| CatalogDiv.Controls.Add(currentGrid); |
| phCatalog.Controls.Add(CatalogDiv); |
| } |
| } |
| void button_Click(object sender, EventArgs e) |
| { |
| ((Button)sender).CssClass = (((Button)sender).CssClass == "rgExpand") ? "rgCollapse" : "rgExpand"; |
| } |
| <%@ Page Title="" Language="VB" MasterPageFile="~/Web_Masterpages/Application.master" AutoEventWireup="false" CodeFile="ProductManagement.aspx.vb" Inherits="Web_Application_Administrators_Schemes_ProductManagement" %> |
| <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> |
| <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> |
| </asp:Content> |
| <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> |
| <table cellpadding="5" cellspacing="0" width="100%" class="ContentTable"> |
| <tr> |
| <td valign="top"> |
| <asp:Label ID="Label1" runat="server" CssClass="headingmed" |
| Text="Manage Products"></asp:Label> |
| <br /> |
| <br /> |
| <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" width="100%" |
| HorizontalAlign="NotSet" LoadingPanelID="RadAjaxLoadingPanel1"> |
| <telerik:RadGrid ID="RadGridProducts" runat="server" |
| AllowAutomaticDeletes="True" AllowAutomaticInserts="True" |
| AllowAutomaticUpdates="True" AllowFilteringByColumn="True" AllowPaging="True" |
| AllowSorting="True" DataSourceID="SqlDataSourceProduct" GridLines="None" |
| Skin="Forest" AutoGenerateColumns="False" PageSize="15"> |
| <HeaderContextMenu EnableTheming="True" Skin="Gray"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| </HeaderContextMenu> |
| <ExportSettings FileName="Schemes" IgnorePaging="True" OpenInNewWindow="True"> |
| <Pdf AllowCopy="True" Author="Prosperity Africa Web Amanagement System" |
| Creator="Prosperity Africa Web Amanagement System" PageHeight="297mm" |
| PageWidth="210mm" PaperSize="A4" /> |
| </ExportSettings> |
| <MasterTableView commanditemdisplay="Top" datasourceid="SqlDataSourceProduct" |
| DataKeyNames="product_uniqueid,scheme_uniqueid"> |
| <NoRecordsTemplate> |
| <asp:Label ID="NoRecordsTemplate" runat="server" |
| Text="No records were found."> </asp:Label> |
| </NoRecordsTemplate> |
| <CommandItemSettings AddNewRecordText="Add new product" /> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn DataField="product_uniqueid" DataType="System.Int32" |
| HeaderText="product_uniqueid" ReadOnly="True" SortExpression="product_uniqueid" |
| UniqueName="product_uniqueid" Visible="False"> |
| </telerik:GridBoundColumn> |
| <telerik:GridTemplateColumn UniqueName="product_scheme" |
| DataField="scheme_name" HeaderText="Scheme" SortExpression="scheme_name"> |
| <EditItemTemplate> |
| <telerik:RadComboBox ID="RadComboBoxProductScheme" Runat="server" |
| DataSourceID="SqlDataSourceSchemes" DataTextField="scheme_name" |
| DataValueField="scheme_uniqueid" MarkFirstMatch="True" Skin="Forest" |
| SelectedValue='<%# Bind("product_scheme") %>' Width="175px"> |
| <Items> |
| <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" |
| Value="RadComboBoxItem1" /> |
| </Items> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| </telerik:RadComboBox> |
| </EditItemTemplate> |
| <ItemTemplate> |
| <asp:Label ID="LabelProductScheme" runat="server" |
| Text='<%# Eval("scheme_name") %>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn DataField="product_description" HeaderText="Name" |
| SortExpression="product_description" UniqueName="product_description"> |
| <EditItemTemplate> |
| <telerik:RadTextBox ID="RadTextBoxProductDescription" Runat="server" |
| LabelCssClass="radLabelCss_Gray" MaxLength="255" Skin="Forest" |
| Text='<%# Bind("product_description") %>' Width="175px"> |
| </telerik:RadTextBox> |
| <asp:RequiredFieldValidator ID="RequiredFieldProductDescription" runat="server" |
| ControlToValidate="RadTextBoxProductDescription" Display="Dynamic" |
| ErrorMessage="Product Description is required.">Product Description is required.</asp:RequiredFieldValidator> |
| </EditItemTemplate> |
| <ItemTemplate> |
| <asp:Label ID="LabelProductDescription" runat="server" |
| Text='<%# Eval("product_description") %>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn UniqueName="product_startdate" |
| DataField="product_startdate" DataType="System.DateTime" |
| HeaderText="Start Date" SortExpression="product_startdate"> |
| <EditItemTemplate> |
| <telerik:RadDatePicker ID="RadDatePickerStartDate" Runat="server" |
| Culture="English (South Africa)" |
| DbSelectedDate='<%# Bind("product_startdate") %>' Skin="Forest" |
| MinDate="2000-01-01"> |
| <DateInput LabelCssClass="radLabelCss_Gray" Skin="Gray"> |
| </DateInput> |
| <Calendar Skin="Forest"> |
| </Calendar> |
| <DatePopupButton HoverImageUrl="" ImageUrl="" /> |
| </telerik:RadDatePicker> |
| <asp:RequiredFieldValidator ID="RequiredFieldValidatorStartDate" |
| runat="server" ControlToValidate="RadDatePickerStartDate" |
| Display="Dynamic" ErrorMessage="Start Date is required.">Start Date is required.</asp:RequiredFieldValidator> |
| </EditItemTemplate> |
| <ItemTemplate> |
| <asp:Label ID="LabelSchemeStartDate" runat="server" |
| Text='<%# Eval("product_startdate", "{0:d}") %>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn UniqueName="product_enddate" |
| DataField="product_enddate" DataType="System.DateTime" |
| HeaderText="End Date" SortExpression="product_enddate"> |
| <EditItemTemplate> |
| <telerik:RadDatePicker ID="RadDatePickerProductEndDate" Runat="server" |
| Culture="English (South Africa)" |
| DbSelectedDate='<%# Bind("product_enddate") %>' Skin="Forest" |
| MinDate="2003-01-01"> |
| <DateInput LabelCssClass="radLabelCss_Gray" Skin="Gray"> |
| </DateInput> |
| <Calendar Skin="Forest"> |
| </Calendar> |
| <DatePopupButton HoverImageUrl="" ImageUrl="" /> |
| </telerik:RadDatePicker> |
| </EditItemTemplate> |
| <ItemTemplate> |
| <asp:Label ID="LabelProductEndDate" runat="server" |
| Text='<%# Eval("product_enddate", "{0:d}") %>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn DataField="product_maximumage" |
| DataType="System.Decimal" HeaderText="Maximum Age" |
| SortExpression="product_maximumage" |
| UniqueName="product_maximumage" Visible="False"> |
| <EditItemTemplate> |
| <telerik:RadNumericTextBox ID="RadNumericTextBoxMaximumAge" |
| Runat="server" Culture="English (South Africa)" |
| DbValue='<%# Bind("product_maximumage") %>' InvalidStyleDuration="500" |
| LabelCssClass="radLabelCss_Gray" MaxValue="99" MinValue="0" |
| Skin="Forest" Value="65" Width="75px"> |
| </telerik:RadNumericTextBox> |
| </EditItemTemplate> |
| <ItemTemplate> |
| <asp:Label ID="LabelMaximumAge" runat="server" |
| Text='<%# Eval("product_maximumage", "{0:N}") %>'></asp:Label> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridBoundColumn DataField="product_lasteditedbyuser" |
| HeaderText="product_lasteditedbyuser" ReadOnly="True" |
| SortExpression="product_lasteditedbyuser" UniqueName="product_lasteditedbyuser" |
| Visible="False"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="product_lasteditedon" |
| DataType="System.DateTime" HeaderText="product_lasteditedon" ReadOnly="True" |
| SortExpression="product_lasteditedon" UniqueName="product_lasteditedon" |
| Visible="False"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="product_lasteditedip" |
| HeaderText="product_lasteditedip" ReadOnly="True" |
| SortExpression="product_lasteditedip" UniqueName="product_lasteditedip" |
| Visible="False"> |
| </telerik:GridBoundColumn> |
| <telerik:GridCheckBoxColumn DataField="product_active" |
| DataType="System.Boolean" HeaderText="Active" |
| SortExpression="product_active" UniqueName="product_active"> |
| </telerik:GridCheckBoxColumn> |
| <telerik:GridEditCommandColumn ButtonType="ImageButton"> |
| </telerik:GridEditCommandColumn> |
| <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" |
| ConfirmText="Are you sure you want to delete this Product?" Text="Delete" |
| UniqueName="column"> |
| </telerik:GridButtonColumn> |
| </Columns> |
| <NestedViewTemplate> |
| <fieldset style="padding:10px;"> |
| <legend style="padding:5px;"><b>Product Items bound to:</b> |
| <asp:Label ID="LabelID" Font-Bold="true" Font-Italic="true" Text='<%# Eval("product_uniqueid") %>' Visible="false" runat="server" /> |
| <asp:Label ID="LabelProductName" Font-Bold="true" Font-Italic="true" Text='<%# Eval("product_description") %>' runat="server" /> |
| </legend> |
| <asp:SqlDataSource ID="SqlDataSourceProductItemsByProduct" runat="server" |
| ConnectionString="<%$ ConnectionStrings:websiteconnstring %>" |
| SelectCommand="SELECT [itemisedproduct_description] FROM [itemisedproduct] WHERE ([itemisedproduct_product_uniqueid] = @itemisedproduct_product_uniqueid) ORDER BY [itemisedproduct_description]"> |
| <SelectParameters> |
| <asp:ControlParameter ControlID="LabelID" Name="itemisedproduct_product_uniqueid" |
| PropertyName="Text" Type="Int32" /> |
| </SelectParameters> |
| </asp:SqlDataSource> |
| <asp:DataList ID="DataListProductItems" runat="server" |
| DataSourceID="SqlDataSourceProductItemsByProduct"> |
| <ItemTemplate> |
| <asp:Label ID="itemisedproduct_descriptionLabel" runat="server" |
| Text='<%# Eval("itemisedproduct_description") %>' /> |
| </ItemTemplate> |
| </asp:DataList> |
| </fieldset> |
| <br /> |
| <fieldset style="padding:10px;"> |
| <legend style="padding:5px;"><b>Service Providers bound to:</b> |
| <asp:Label ID="LabelID1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("product_uniqueid") %>' Visible="false" runat="server" /> |
| <asp:Label ID="LabelProductName1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("product_description") %>' runat="server" /> |
| </legend> |
| <asp:SqlDataSource ID="SqlDataSourceServiceProviders" runat="server" |
| ConnectionString="<%$ ConnectionStrings:websiteconnstring %>" |
| SelectCommand="SELECT serviceproviders.serviceproviders_description, serviceproviders.serviceproviders_name, serviceproviderproduct.serviceproviderproduct_percentage FROM serviceproviderproduct INNER JOIN serviceproviders ON serviceproviderproduct.serviceproviderproduct_provider = serviceproviders.serviceproviders_uniqueid WHERE (serviceproviderproduct.serviceproviderproduct_product = @serviceproviderproduct_product)"> |
| <SelectParameters> |
| <asp:ControlParameter ControlID="LabelID1" Name="serviceproviderproduct_product" |
| PropertyName="Text" /> |
| </SelectParameters> |
| </asp:SqlDataSource> |
| <asp:DataList ID="DataListServiceProvider" runat="server" |
| DataSourceID="SqlDataSourceServiceProviders" Width="750px"> |
| <ItemTemplate> |
| <table cellpadding="5" cellspacing="0"> |
| <tr> |
| <td width="250"> |
| <asp:Label ID="serviceproviders_nameLabel" runat="server" |
| Text='<%# Eval("serviceproviders_name") %>' /> |
| </td> |
| <td width="250"> |
| <asp:Label ID="serviceproviderproduct_percentageLabel" runat="server" |
| Text='<%# Eval("serviceproviderproduct_percentage") %>' /> |
| %</td> |
| </tr> |
| </table> |
| </ItemTemplate> |
| </asp:DataList> |
| <br /> |
| </fieldset> |
| <br /> |
| </NestedViewTemplate> |
| </MasterTableView> |
| <FilterMenu EnableTheming="True"> |
| <CollapseAnimation Type="OutQuint" Duration="200"> |
| </CollapseAnimation> |
| </FilterMenu> |
| </telerik:RadGrid> |
| <br /> |
| <asp:Label ID="LabelUser" runat="server"></asp:Label> |
| from |
| <asp:Label ID="LabelUserIP" runat="server"></asp:Label> |
| is editing this page on |
| <asp:Label ID="LabelDateNow" runat="server"></asp:Label> |
| <br /> |
| </telerik:RadAjaxPanel> |
| <asp:SqlDataSource ID="SqlDataSourceSchemes" runat="server" |
| ConnectionString="<%$ ConnectionStrings:websiteconnstring %>" |
| SelectCommand="SELECT [scheme_uniqueid], [scheme_name] FROM [schemes] WHERE ([scheme_active] = @scheme_active) ORDER BY [scheme_name]"> |
| <SelectParameters> |
| <asp:Parameter DefaultValue="True" Name="scheme_active" Type="Boolean" /> |
| </SelectParameters> |
| </asp:SqlDataSource> |
| <asp:SqlDataSource ID="SqlDataSourceProduct" runat="server" |
| ConnectionString="<%$ ConnectionStrings:websiteconnstring %>" |
| SelectCommand="SELECT products.product_uniqueid, products.product_scheme, products.product_description, products.product_startdate, products.product_enddate, products.product_maximumage, products.product_lasteditedbyuser, products.product_lasteditedon, products.product_lasteditedip, products.product_active, schemes.scheme_name, schemes.scheme_uniqueid FROM products INNER JOIN schemes ON products.product_scheme = schemes.scheme_uniqueid ORDER BY products.product_scheme, products.product_description" |
| UpdateCommand="UPDATE [products] SET [product_scheme] = @product_scheme, [product_description] = @product_description, [product_startdate] = @product_startdate, [product_enddate] = @product_enddate, [product_maximumage] = @product_maximumage, [product_lasteditedbyuser] = @product_lasteditedbyuser, [product_lasteditedon] = @product_lasteditedon, [product_lasteditedip] = @product_lasteditedip, [product_active] = @product_active WHERE [product_uniqueid] = @product_uniqueid" |
| DeleteCommand="DELETE FROM [products] WHERE [product_uniqueid] = @product_uniqueid" |
| InsertCommand="INSERT INTO [products] ([product_scheme], [product_description], [product_startdate], [product_enddate], [product_maximumage], [product_lasteditedbyuser], [product_lasteditedon], [product_lasteditedip], [product_active]) VALUES (@product_scheme, @product_description, @product_startdate, @product_enddate, @product_maximumage, @product_lasteditedbyuser, @product_lasteditedon, @product_lasteditedip, @product_active)"> |
| <DeleteParameters> |
| <asp:Parameter Name="product_uniqueid" Type="Int32" /> |
| </DeleteParameters> |
| <UpdateParameters> |
| <asp:Parameter Name="product_scheme" Type="Int32" /> |
| <asp:Parameter Name="product_description" Type="String" /> |
| <asp:Parameter Name="product_startdate" Type="DateTime" /> |
| <asp:Parameter Name="product_enddate" Type="DateTime" DefaultValue="2099/12/31" /> |
| <asp:Parameter Name="product_maximumage" Type="Decimal" DefaultValue="65"/> |
| <asp:ControlParameter Name="product_lasteditedbyuser" ControlID="LabelUser" PropertyName="Text" Type="String" /> |
| <asp:ControlParameter Name="product_lasteditedon" ControlID="LabelDateNow" PropertyName="Text" Type="String" /> |
| <asp:ControlParameter Name="product_lasteditedip" ControlID="LabelUserIP" PropertyName="Text" Type="String" /> |
| <asp:Parameter Name="product_uniqueid" Type="Int32" /> |
| </UpdateParameters> |
| <InsertParameters> |
| <asp:Parameter Name="product_scheme" Type="Int32" /> |
| <asp:Parameter Name="product_description" Type="String" /> |
| <asp:Parameter Name="product_startdate" Type="DateTime" /> |
| <asp:Parameter Name="product_enddate" Type="DateTime" DefaultValue="2099/12/31" /> |
| <asp:Parameter Name="product_maximumage" Type="Decimal" DefaultValue="65"/> |
| <asp:ControlParameter Name="product_lasteditedbyuser" ControlID="LabelUser" PropertyName="Text" Type="String" /> |
| <asp:ControlParameter Name="product_lasteditedon" ControlID="LabelDateNow" PropertyName="Text" Type="String" /> |
| <asp:ControlParameter Name="product_lasteditedip" ControlID="LabelUserIP" PropertyName="Text" Type="String" /> |
| <asp:Parameter Name="product_active" Type="Boolean" /> |
| </InsertParameters> |
| </asp:SqlDataSource> |
| <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" |
| BackColor="#666666" MinDisplayTime="500" style="text-align: center" |
| Transparency="50" Width="100%" Height="100%"> |
| <img alt="Loading..." |
| src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' |
| style="border:0px;" /> |
| </telerik:RadAjaxLoadingPanel> |
| </td> |
| </tr> |
| </table> |
| </asp:Content> |
| Partial Class Web_Application_Administrators_Schemes_ProductManagement |
| Inherits System.Web.UI.Page |
| Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
| 'Handles User Session Expired |
| Dim str_GetUsername As String |
| Try |
| str_GetUsername = Membership.GetUser.ToString() |
| Catch ex As Exception |
| Response.Redirect("~\Web_Application\Default.aspx") |
| End Try |
| LabelDateNow.Text = Date.Now.ToString |
| LabelUser.Text = Membership.GetUser.ToString() |
| LabelUserIP.Text = Request.UserHostAddress.ToString() |
| End Sub |
| Protected Sub RadGridProducts_ItemDeleted(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDeletedEventArgs) Handles RadGridProducts.ItemDeleted |
| If Not e.Exception Is Nothing Then |
| e.ExceptionHandled = True |
| DisplayMessage("Product " + e.Item("product_description").Text + " cannot be deleted. The most likely reasons for this is that there are items linked to this product. Reason: " + e.Exception.Message) |
| Else |
| DisplayMessage("Product " + e.Item("product_description").Text + " deleted. ") |
| End If |
| End Sub |
| Protected Sub RadGridProducts_ItemUpdated(ByVal source As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles RadGridProducts.ItemUpdated |
| Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem) |
| If Not e.Exception Is Nothing Then |
| e.KeepInEditMode = True |
| e.ExceptionHandled = True |
| DisplayMessage("Product " + e.Item("product_description").Text + " cannot be updated. Reason: " + e.Exception.Message) |
| Else |
| DisplayMessage("Product " + e.Item("product_description").Text + " updated") |
| End If |
| End Sub |
| Protected Sub RadGridProducts_ItemInserted(ByVal source As Object, ByVal e As Telerik.Web.UI.GridInsertedEventArgs) Handles RadGridProducts.ItemInserted |
| If Not e.Exception Is Nothing Then |
| e.ExceptionHandled = True |
| e.KeepInInsertMode = True |
| DisplayMessage("Product cannot be inserted. Reason: " + e.Exception.Message) |
| Else |
| DisplayMessage("Product inserted") |
| End If |
| End Sub |
| Private Sub DisplayMessage(ByVal text As String) |
| RadGridProducts.Controls.Add(New LiteralControl(text)) |
| End Sub |
| End Class |
| <%@ Master Language="VB" CodeFile="Application.master.vb" Inherits="Web_Masterpages_Application" %> |
| <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title></title> |
| <asp:ContentPlaceHolder id="head" runat="server"> |
| </asp:ContentPlaceHolder> |
| <link href="../App_Themes/Application/Application.css" rel="stylesheet" type="text/css" /> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="ScriptManager1" runat="server" |
| EnableTheming="True"> |
| </telerik:RadScriptManager> |
| <table align="center" cellpadding="0" cellspacing="0" class="OutsideTable"> |
| <tr> |
| <td> |
| <table cellpadding="0" cellspacing="0" class="MastheadTable"> |
| <tr> |
| <td align="left"> |
| <asp:HyperLink ID="HyperLink1" runat="server" ImageUrl="~/Web_Images/PMALOGO.png">HyperLink</asp:HyperLink> |
| <br /> |
| <br /> |
| </td> |
| <td align="right"> |
| <asp:Login ID="LoginMasthead" runat="server" DisplayRememberMe="False" |
| LoginButtonType="Link" PasswordRecoveryText="Recover Password" |
| VisibleWhenLoggedIn="False" Orientation="Horizontal" |
| PasswordRecoveryUrl="~/Web_Membership/recoverpassword.aspx"> |
| <LayoutTemplate> |
| <table border="0" cellpadding="1" cellspacing="0" |
| style="border-collapse: collapse;"> |
| <tr> |
| <td> |
| <table border="0" cellpadding="0"> |
| <tr> |
| <td> |
| </td> |
| <td> |
| <telerik:RadTextBox ID="UserName" Runat="server" |
| EmptyMessage="Enter Your User Name:" LabelCssClass="radLabelCss_Gray" |
| Skin="Forest" Width="150px"> |
| </telerik:RadTextBox> |
| <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" |
| ControlToValidate="UserName" ErrorMessage="User Name is required." |
| ToolTip="User Name is required." ValidationGroup="ctl00$LoginMasthead">*</asp:RequiredFieldValidator> |
| </td> |
| <td> |
| </td> |
| <td> |
| <telerik:RadTextBox ID="Password" Runat="server" EmptyMessage="Password" |
| LabelCssClass="radLabelCss_Gray" Skin="Forest" TextMode="Password" |
| Width="150px"> |
| </telerik:RadTextBox> |
| <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" |
| ControlToValidate="Password" ErrorMessage="Password is required." |
| ToolTip="Password is required." ValidationGroup="ctl00$LoginMasthead">*</asp:RequiredFieldValidator> |
| </td> |
| <td> |
| <asp:LinkButton ID="LoginLinkButton" runat="server" CommandName="Login" |
| ValidationGroup="ctl00$LoginMasthead">Log In</asp:LinkButton> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="5" style="color: Red;"> |
| <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="5"> |
| <asp:HyperLink ID="PasswordRecoveryLink" runat="server" |
| NavigateUrl="~/Web_Membership/recoverpassword.aspx">Recover Password</asp:HyperLink> |
| <br /> |
| <asp:HyperLink ID="HyperLinkPMA" runat="server" |
| NavigateUrl="http://website.pmafrica.co.za" Target="_blank">Prosperity Management Africa Website</asp:HyperLink> |
| </td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| </table> |
| </LayoutTemplate> |
| </asp:Login> |
| <asp:LoginStatus ID="LoginStatus1" runat="server" LoginText="" /> |
| <br /> |
| <asp:LoginView ID="LoginView1" runat="server"> |
| <LoggedInTemplate> |
| <asp:HyperLink ID="HyperLinkPMALoggedIn" runat="server" NavigateUrl="http://website.pmafrica.co.za" Target="_blank">Prosperity Management Africa Website</asp:HyperLink><br /> |
| Active Premium Period: <% Response.Write(Application("PremiumMonth"))%> - <% Response.Write(Application("PremiumStartDate"))%> to <% Response.Write(Application("PremiumEndDate"))%>.<br /> |
| Active Claims Period: <% Response.Write(Application("ClaimMonth"))%> - <% Response.Write(Application("ClaimStartDate"))%> to <% Response.Write(Application("ClaimEndDate"))%>.<br /> |
| </LoggedInTemplate> |
| <AnonymousTemplate> |
| </AnonymousTemplate> |
| </asp:LoginView> |
| <asp:Panel ID="PanelMonthDisplay" Visible="false" runat="server"> |
| </asp:Panel> |
| </td> |
| </tr> |
| </table> |
| <table cellpadding="0" cellspacing="0" class="BodyTable"> |
| <tr> |
| <td align="left" valign="top"> |
| <table cellpadding="0" cellspacing="0"> |
| <tr> |
| <td class="PanelBarCell"> |
| <telerik:RadPanelBar ID="RadPanelBar1" Runat="server" |
| DataSourceID="Web_Application" Skin="Forest" Width="200px"> |
| <CollapseAnimation Type="None" Duration="100"></CollapseAnimation> |
| <ExpandAnimation Type="None" Duration="100"></ExpandAnimation> |
| </telerik:RadPanelBar> |
| </td> |
| <td class="ContentCell"> |
| <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> |
| </asp:ContentPlaceHolder> |
| </td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| </table> |
| <asp:SiteMapDataSource ID="Web_Application" runat="server" |
| ShowStartingNode="False" SiteMapProvider="Web_Application" /> |
| </form> |
| </body> |
| </html> |
Hello,
I just migrated from the classic combobox to the new RadAjax, two problems:
1) it is much slower bringing up the drop down list and secondly I have not been able to use my old skin. Any suggestion?
AZ.
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SchedulerTest.aspx.cs" Inherits="Datamex.Projects.Saturnus.Pages.SchedulerTest" %> |
| <%@ Register Assembly="Telerik.Web.UI, Version=2009.1.402.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" |
| Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" > |
| <head runat="server"> |
| <title>OnClientAppointmentInserting eventArgs.get_targetSlot().get_startTime() in combination with TimelineView-StartTime</title> |
| <telerik:RadScriptBlock runat="server" ID="RadScriptBlock1"> |
| <script type="text/javascript"> |
| function ClientNewAppointment(sender, eventArgs) { |
| // retrieve the scheduler |
| var scheduler = $find('<%= Scheduler.ClientID %>'); |
| // retrieve target |
| var Target = eventArgs.get_targetSlot(); |
| // Retrieve the 'start time settings' |
| var dayStartTime = scheduler.get_firstDayStart(); |
| // Retrieve the current data |
| var dayStartDate = scheduler.get_selectedDate(); |
| // calculate the difference |
| var difference = (dayStartTime - dayStartDate); |
| // retrieve the start time settings |
| var startTime = new Date(Target.get_startTime()); |
| startTime.setMilliseconds(startTime.getMilliseconds() + difference); |
| // retrieve the end time settings |
| var endTime = new Date(startTime); |
| endTime.setMinutes(endTime.getMinutes() + scheduler.get_minutesPerRow()); |
| // show the orriginal data + what it should be |
| alert("Data as shown through eventArgs \n\nstart: " + Target.get_startTime() + "\nEnd: " + Target.get_endTime() |
| + "\n\nData as shown after calculations \n\nstart: "+ startTime + "\nEnd: "+ endTime); |
| eventArgs.set_cancel(true); |
| } |
| </script> |
| </telerik:RadScriptBlock> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <div> |
| <telerik:RadScheduler |
| ID="Scheduler" |
| runat="server" |
| DataSourceID="" |
| DataStartField="" |
| DataEndField="" |
| DataKeyField="" |
| DataSubjectField="" |
| SelectedView="TimelineView" |
| StartInsertingInAdvancedForm="True" |
| GroupBy="Employees" |
| OnClientAppointmentInserting="ClientNewAppointment" |
| > |
| <%-- It fails with this set, when the timelineview starts at a specific time the clientside javascript gets killed --%> |
| <TimelineView GroupingDirection="Vertical" ColumnHeaderDateFormat="HH:mm" NumberOfSlots="27" |
| SlotDuration="00:30:00" StartTime="07:00:00" /> |
| <ResourceTypes> |
| <telerik:ResourceType DataSourceID="EmployeeDataSource" ForeignKeyField="EmployeeID" |
| KeyField="EmployeeID" Name="Employees" TextField="aspnet_User_Details.UserName" /> |
| </ResourceTypes> |
| </telerik:RadScheduler> |
| </div> |
| </form> |
| </body> |
| </html> |
The HTML of the controls is successfully updated however JavaScript is not executed by the built-in ASP.NET MVC Ajax implementation. We would provide a workaround in the future.
Does it mean currently there is no AJAX support that we can use with Telerik controls in MVC unless we use JQuery and client side programming to bind the datasource. Is it true?
Is there any plans and timeline to support AJAX in future. It is strange that RadControls for ASP.NET "AJAX" does not have good AJAX support in contradiction to the name of the control itself.
Looking forward to have more AJAX support from Telerik on "AJAX" Controls.
Thanks
| function validateRadUpload(source, e) |
| { |
| e.IsValid = false; |
| var upload = $find("<%= rulThumb.ClientID %>"); |
| var inputs = upload.getFileInputs(); |
| for (var i = 0; i < inputs.length; i++) |
| { |
| //check for empty string or invalid extension |
| if (inputs[i].value != "" && upload.isExtensionValid(inputs[i].value)) |
| { |
| e.IsValid = true; |
| break; |
| } |
| } |
| } |