or
| With rsSchedule |
| Dim stcWorkSchedule As New WorkScheduleTimeCollection stcWorkSchedule = Database.SelectWorkScheduleTimes(ScheduleUniqueID, .VisibleRangeStart, .VisibleRangeEnd, True) |
| .DataSource = stcWorkSchedule |
| .DataKeyField = "UniqueID" |
| .DataSubjectField = "Name" |
| .DataStartField = "StartTime" |
| .DataEndField = "EndTime" |
| .DataRecurrenceParentKeyField = "UniqueID" |
| .DataRecurrenceField = "RecurrenceRuleValue" |
| .DataBind() |
| End With |
| Private Function CreateRecurrenceRule(wstTime As WorkScheduleTime) As WorkScheduleTime |
| With wstTime |
| Dim rrRange As New RecurrenceRange() |
| rrRange.Start = .DateActiveFrom |
| rrRange.RecursUntil = .DateActiveTo |
| rrRange.EventDuration = .EndTime - .StartTime |
| 'Here ".DayFrequency" is a class of boolean values representing the 7 character comma delimited day 'frequency list I receive from the foreign schedule data, that class is "converted" to the Telerik 'RecurrenceDay object. |
| Dim rdDays As RecurrenceDay = Me.BuildScheduleDayRecurrence(.DayFrequency) |
| Dim wrRule As New WeeklyRecurrenceRule(1, rdDays, rrRange) |
| .RecurrenceRule = wrRule |
| .RecurrenceRuleValue = wrRule.ToString |
| .RecurrenceRuleValue = .RecurrenceRuleValue.Replace(vbCr, "/r") |
| .RecurrenceRuleValue = .RecurrenceRuleValue.Replace(vbLf, "/n") |
| End With |
| Return wstTime |
| End Sub |
| #region Grid Events |
| protected void RadGridNestedControl_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) |
| { |
| GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; |
| string strParentRelationID = dataItem.GetDataKeyValue(this.ParentRelationColumn).ToString(); |
| e.DetailTableView.DataSource = Source.Tables[1].Select(ChildRelationColumn + "=" + strParentRelationID); |
| RadGrid obj = (RadGrid)source ; |
| //obj.Rebind(); |
| } |
| protected void RadGridNestedControl_ItemDataBound(object source, Telerik.Web.UI.GridItemEventArgs e) |
| { |
| if (this.PageType == (int)PageName.HeaderFooterListing) |
| { |
| if (e.Item is GridDataItem && e.Item.OwnerTableView.Name == "ParentView") |
| { |
| GridDataItem dataItem = e.Item as GridDataItem; |
| GridTableCell wgColEdit = (GridTableCell)dataItem["Edit"]; |
| if (wgColEdit != null) |
| { |
| //Creating QueryString |
| string[] editParam = this.NavigationEditParameters; |
| string strQueryString = string.Empty; |
| foreach (string str in editParam) |
| { |
| if (dataItem[str] != null) |
| { |
| if (dataItem[str].Text != " ") |
| strQueryString += str + "=" + dataItem[str].Text + "&"; |
| else |
| strQueryString += str + "=" + ServiceNet.BLL.Global.NullInteger.ToString() + "&"; |
| } |
| } |
| strQueryString += "PKSourceClientID=" + intClientID; |
| wgColEdit.HorizontalAlign = HorizontalAlign.Center; |
| (wgColEdit.Controls[0] as ImageButton).Style.Add("Cursor", "Pointer"); |
| wgColEdit.ToolTip = ResourceLang.GetString("C_Edit"); |
| string url = ((ServiceNet.Web.BasePage)Page).ImagesLocation + "btn_edit_small" + ((ServiceNet.Web.BasePage)Page).ImageExtension; |
| wgColEdit.Text = "<a href='" + this.NavigationEditURL + "?" + strQueryString + "' ><img src='" + url + "' OnMouseOver=ChangeImage(this,'btn_edit_small',1) OnMouseOut=ChangeImage(this,'btn_edit_small',2) OnMouseDown=ChangeImage(this,'btn_edit_small',3) OnMouseUp=ChangeImage(this,'btn_edit_small',4) onKeyDown=ChangeImage(this,'btn_edit_small',5) OnKeyUp=ChangeImage(this,'btn_edit_small',6)></a>"; |
| } |
| } |
| if (e.Item is GridDataItem && e.Item.OwnerTableView.Name == "ChildView") |
| { |
| GridDataItem dataItem = e.Item as GridDataItem; |
| GridTableCell wgColPreview = (GridTableCell)dataItem["Add"]; |
| if (wgColPreview != null) |
| { |
| int intPKID = Convert.ToInt32(dataItem.GetDataKeyValue(this.ChildRelationColumn).ToString()); |
| int intTypeValueID = ServiceNet.BLL.Global.NullInteger; |
| int intPKUserSourceID = ServiceNet.BLL.Global.NullInteger; |
| int intPopUpHeight = ServiceNet.BLL.Global.NullInteger; |
| int intPopUpWidth = ServiceNet.BLL.Global.NullInteger; |
| string strDisplayText = dataItem["DisplayText"].Text; |
| //Getting ParentRow Data |
| DataRow[] drParent = Source.Tables[0].Select("PKID =" + intPKID); |
| if (drParent != null && drParent.Length > 0) |
| { |
| intTypeValueID = DatabaseHelper.GetNullableInt32(drParent[0], "TypeValueID"); |
| intPKUserSourceID = DatabaseHelper.GetNullableInt32(drParent[0], "PKUserSourceID"); |
| intPopUpHeight = DatabaseHelper.GetNullableInt32(drParent[0], "PopUpHeight"); |
| intPopUpWidth = DatabaseHelper.GetNullableInt32(drParent[0], "PopUpWidth"); |
| } |
| wgColPreview.HorizontalAlign = HorizontalAlign.Center; |
| wgColPreview.ToolTip = ResourceLang.GetString("C_Preview"); |
| string url = ((ServiceNet.Web.BasePage)Page).ImagesLocation + "btn_ViewSchedules" + ((ServiceNet.Web.BasePage)Page).ImageExtension; |
| wgColPreview.Text = "<a href='# style=cursor:hand;'><img onclick=\"javascript:ShowDataPopUp('" + this.ControlSessionData.LoggedUserPreferences.LanguageID + "','" + intTypeValueID + "','" + strDisplayText + "','" + intPKUserSourceID + "','" + intPopUpHeight + "','" + intPopUpWidth + "');\" src='" + url + "' OnMouseOver=ChangeImage(this,'btn_ViewSchedules',1) OnMouseOut=ChangeImage(this,'btn_ViewSchedules',2) OnMouseDown=ChangeImage(this,'btn_ViewSchedules',3) OnMouseUp=ChangeImage(this,'btn_ViewSchedules',4) onKeyDown=ChangeImage(this,'btn_ViewSchedules',5) OnKeyUp=ChangeImage(this,'btn_ViewSchedules',6)></a>"; |
| } |
| } |
| } |
| } |
| protected void RadGridNestedControl_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
| { |
| //if (!e.IsFromDetailTable) |
| //{ |
| // LoadData(this.Source); |
| //} |
| } |
| #endregion |
| public void LoadData(DataSet dsSource) |
| { |
| this.RadGridNestedControl = new RadGrid(); |
| this.RadGridNestedControl.ID = "RadGrid1"; |
| this.RadGridNestedControl.NeedDataSource += new GridNeedDataSourceEventHandler(this.RadGridNestedControl_NeedDataSource); |
| this.RadGridNestedControl.DetailTableDataBind += new GridDetailTableDataBindEventHandler(this.RadGridNestedControl_DetailTableDataBind); |
| this.RadGridNestedControl.ItemDataBound += new GridItemEventHandler(this.RadGridNestedControl_ItemDataBound); |
| this.RadGridNestedControl.EnableEmbeddedScripts = true; |
| this.RadGridNestedControl.Width = Unit.Percentage(100); |
| thisthis.RadGridNestedControl.PageSize = this.ParentNumberofRecords; |
| this.RadGridNestedControl.AllowPaging = true; |
| this.RadGridNestedControl.AllowSorting = true; |
| this.RadGridNestedControl.AutoGenerateColumns = false; |
| if (this.Source != null) |
| { |
| RadGridNestedControl.DataSource = dsSource.Tables[0]; |
| RadGridNestedControl.MasterTableView.DataKeyNames = new string[] { this.ParentRelationColumn }; |
| RadGridNestedControl.MasterTableView.Name = "ParentView"; |
| //Creating Columns |
| foreach (DataColumn dcol in dsSource.Tables[0].Columns) |
| { |
| if (this.ParentExcludedFields != ServiceNet.BLL.Global.NullString) |
| { |
| if (this.ParentExcludedFields.IndexOf("," + dcol.ColumnName.ToUpper() + ",") < 0) |
| { |
| if (this.ResourceLangPrefix != null && this.ResourceLangPrefix != "") |
| dcol.Caption = ResourceLang.GetString(this.ResourceLangPrefix + "_" + dcol.ColumnName); |
| else |
| dcol.Caption = ResourceLang.GetString(dcol.ColumnName); |
| if (dcol.Caption == string.Empty) |
| dcoldcol.Caption = dcol.ColumnName; |
| GridBoundColumn wgCol = new GridBoundColumn(); |
| RadGridNestedControl.MasterTableView.Columns.Add(wgCol); |
| wgCol.DataField = dcol.ColumnName; |
| wgCol.HeaderText = dcol.Caption; |
| wgCol.UniqueName = dcol.ColumnName; |
| wgCol.AllowSorting = true; |
| } |
| else |
| { |
| GridBoundColumn wgCol = new GridBoundColumn(); |
| RadGridNestedControl.MasterTableView.Columns.Add(wgCol); |
| wgCol.DataField = dcol.ColumnName; |
| wgCol.Display = false; |
| } |
| } |
| else |
| { |
| dcol.Caption = ResourceLang.GetString(this.ResourceLangPrefix + "_" + dcol.ColumnName); |
| if (dcol.Caption == string.Empty) |
| dcoldcol.Caption = dcol.ColumnName; |
| GridBoundColumn wgCol = new GridBoundColumn(); |
| RadGridNestedControl.MasterTableView.Columns.Add(wgCol); |
| wgCol.DataField = dcol.ColumnName; |
| wgCol.HeaderText = dcol.Caption; |
| wgCol.UniqueName = dcol.ColumnName; |
| wgCol.AllowSorting = true; |
| } |
| } |
| //Adding Buttons to ParentGrid |
| if (this.IsParentRecordEditButton) |
| AddButtonColumnsToGrid("Edit", ResourceLang.GetString("C_Edit")); |
| if (this.IsParentRecordAddButton) |
| AddButtonColumnsToGrid("Add", ResourceLang.GetString("C_Add")); |
| if (this.IsParentRecordDeleteButton) |
| AddButtonColumnsToGrid("Delete", ResourceLang.GetString("C_Delete")); |
| //Detail Table |
| GridTableView tableDetailView = new GridTableView(RadGridNestedControl); |
| tableDetailView.Width = Unit.Percentage(100); |
| tableDetailView.DataSource = dsSource.Tables[1]; |
| tableDetailView.DataKeyNames = new string[] { this.ChildRelationColumn }; |
| tableDetailView.PageSize = this.ChildNumberofRecords; |
| tableDetailView.Name = "ChildView"; |
| GridRelationFields relationFields = new GridRelationFields(); |
| relationFields.MasterKeyField = this.ParentRelationColumn; |
| relationFields.DetailKeyField = this.ChildRelationColumn; |
| tableDetailView.ParentTableRelation.Add(relationFields); |
| //Creating Child Columns |
| foreach (DataColumn dcol in dsSource.Tables[1].Columns) |
| { |
| if (this.ChildExcludedFields != ServiceNet.BLL.Global.NullString) |
| { |
| if (this.ChildExcludedFields.IndexOf("," + dcol.ColumnName.ToUpper() + ",") < 0) |
| { |
| if (this.ResourceLangPrefix != null && this.ResourceLangPrefix != "") |
| dcol.Caption = ResourceLang.GetString(this.ResourceLangPrefix + "_" + dcol.ColumnName); |
| else |
| dcol.Caption = ResourceLang.GetString(dcol.ColumnName); |
| if (dcol.Caption == string.Empty) |
| dcoldcol.Caption = dcol.ColumnName; |
| GridBoundColumn wgCol = new GridBoundColumn(); |
| wgCol.DataField = dcol.ColumnName; |
| wgCol.HeaderText = dcol.Caption; |
| wgCol.UniqueName = dcol.ColumnName; |
| wgCol.AllowSorting = true; |
| tableDetailView.Columns.Add(wgCol); |
| } |
| else |
| { |
| GridBoundColumn wgCol = new GridBoundColumn(); |
| tableDetailView.Columns.Add(wgCol); |
| wgCol.DataField = dcol.ColumnName; |
| wgCol.Display = false; |
| } |
| } |
| else |
| { |
| dcol.Caption = ResourceLang.GetString(this.ResourceLangPrefix + "_" + dcol.ColumnName); |
| if (dcol.Caption == string.Empty) |
| dcoldcol.Caption = dcol.ColumnName; |
| GridBoundColumn wgCol = new GridBoundColumn(); |
| wgCol.DataField = dcol.ColumnName; |
| wgCol.HeaderText = dcol.Caption; |
| wgCol.UniqueName = dcol.ColumnName; |
| wgCol.AllowSorting = true; |
| tableDetailView.Columns.Add(wgCol); |
| } |
| } |
| //Adding Buttons to ChildGrid |
| if (this.IsChildRecordAddButton) |
| AddButtonColumnsToChildGrid("Add", ResourceLang.GetString("C_Add"), tableDetailView); |
| if (this.IsChildRecordEditButton) |
| AddButtonColumnsToChildGrid("Edit", ResourceLang.GetString("C_Edit"), tableDetailView); |
| if (this.IsChildRecordDeleteButton) |
| AddButtonColumnsToChildGrid("Delete", ResourceLang.GetString("C_Delete"), tableDetailView); |
| RadGridNestedControl.MasterTableView.DetailTables.Add(tableDetailView); |
| this.PlaceHolder1.Controls.Add(RadGridNestedControl); |
| } |
| } |

<
telerik:RadMenu ID="RadMenu1" runat="server" Flow="Horizontal">
<Items>
<telerik:RadMenuItem runat="server" Text="Root Item 1">
<Items>
<telerik:RadMenuItem runat="server" Text="Child Item 1">
<Items>
<telerik:RadMenuItem runat="server" Text="Child Item 1.1" />
<telerik:RadMenuItem runat="server" Text="Child Item 1.2" />
</Items>
</telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="Child Item 2" />
</Items>
</telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="Root Item 2">
<Items>
<telerik:RadMenuItem runat="server" Text="Child Item 2.1" />
</Items>
</telerik:RadMenuItem>
</Items>
</
telerik:RadMenu>
| var dataItem = Sender.get_masterTableView().get_dataItems()[index]; |
| <telerik:EditorTool Name="imagemanager" Enabled="true" /> |

| this._activeItem=e; |
| d(e.get_element()).addClass("rlbActive"); |
| e.ensureVisible(); |
| <telerik:RadListBox ID="mailToSend" runat="server" |
| EmptyMessage="Emailsssssss" Height="150px" Width="200px" |
| SelectionMode="Multiple" AllowTransfer="True" TransferToID="mailToRemove" |
| AutoPostBackOnTransfer="True" AllowReorder="True" AutoPostBackOnReorder="True" |
| EnableDragAndDrop="True" Visible="false"> |
| <EmptyMessageTemplate> |
| Emailsssssss |
| </EmptyMessageTemplate> |
| </telerik:RadListBox> |