or
| protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args) |
| { |
| string[] values = args.Value.Split('|'); |
| if (values.Length > 0) |
| { |
| this.UpdateToolTip(values[0], args.UpdatePanel, int.Parse(values[1])); |
| } |
| } |
| private void UpdateToolTip(string section, UpdatePanel update, int index) |
| { |
| ToolTipContent ctl = (ToolTipContent)Page.LoadControl("tooltipcontent/" + section + ".ascx"); |
| ctl.SetIndex(index); //This sets the values of the controls |
| update.ContentTemplateContainer.Controls.Add(ctl); |
| //At this point (and after) the controls look like they are set correctly in the code |
| //it is only when the tooltip is loaded that it shows incorrectly. |
| } |
| <telerik:RadToolTipManager ID="tltAvailability" runat="server" OnAjaxUpdate="OnAjaxUpdate" RelativeTo="Element" |
| ShowEvent="OnClick" HideEvent="ManualClose" |
| Position="MiddleLeft" Animation=FlyIn RenderInPageRoot="true" Width="250" Height="200" |
| ></telerik:RadToolTipManager> |
| <%@ Control Language="C#" AutoEventWireup="true" CodeFile="repAvailability.ascx.cs" Inherits="cox.applications.web.ehealth.physicianreferral.AvailabilityToolTip" %> |
| <%@ Reference Control="~/tooltipcontent/ToolTipContent.ascx" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <script type="text/javascript"> |
| </script> |
| <asp:FormView ID="fvwAvailability" runat="server" OnItemCreated="CreatedFormItem" OnItemCommand="fvwAvailability_ItemCommand" > |
| <ItemTemplate> |
| Type of Availability:<br /> |
| <telerik:RadComboBox ID="ddlTypes" runat="server" DataValueField="ID" DataTextField="Description" ZIndex="10000" |
| AutoPostBack="true" OnSelectedIndexChanged="SelectedType"> |
| </telerik:RadComboBox><br /> |
| Age Available:<br /> |
| <asp:TextBox ID="txtAge" runat="server" Width="75px" ></asp:TextBox><br /> |
| Range of Availbility:<br /> |
| <telerik:RadComboBox ID="ddlRange" runat="server" DataTextField="Description" DataValueField="ID" ZIndex="10000" > |
| </telerik:RadComboBox><br /> |
| </ItemTemplate> |
| </asp:FormView> |
| <asp:Button ID="btnSave" runat="server" OnClick="SaveClicked" Text="Save" UseSubmitBehavior="false" /> |
| protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args) |
| { |
| _currentPhysician = Shared.CurrentPhysician; |
| string[] values = args.Value.Split('|'); |
| if (values.Length > 0) |
| { |
| Control saveButton = this.UpdateToolTip(values[0], args.UpdatePanel, int.Parse(values[1])); |
| } |
| } |
| private Control UpdateToolTip(string section, UpdatePanel update, int index) |
| { |
| ToolTipContent ctl = (ToolTipContent)Page.LoadControl("tooltipcontent/" + section + ".ascx"); |
| ctl.SetIndex(index); |
| update.ContentTemplateContainer.Controls.Add(ctl); |
| return ctl.SaveButton; |
| } |
| /* THIS CODE IS FROM THE USER CONTROL */ |
| public void SetIndex(int index) |
| { |
| _index = index; |
| SetDataSource(); |
| } |
| protected override void SetDataSource() |
| { |
| if (this._index >= 0) |
| { |
| List<AvailabilityInfo> inf = Shared.CurrentPhysician.AvailabilityInfo; |
| fvwAvailability.DataSource = (from i in inf |
| where inf.IndexOf(i) == this._index |
| select i); |
| _baseInfo = (ApprovableItem)fvwAvailability.DataItem; |
| } |
| else |
| { |
| fvwAvailability.DataSource = null; |
| _baseInfo = new ApprovableItem(Null.NullInteger, StatusType.Pending, Null.NullInteger, Null.NullDate, Shared.User, Null.NullString); |
| } |
| fvwAvailability.DataBind(); |
| } |
| protected void SaveClicked(object sender, EventArgs e) |
| { |
| SaveInfo(); |
| } |
| protected void grdAnnouncements_PreRender(object sender, System.EventArgs e) |
| { |
| foreach (GridItem item in grdAnnouncements.MasterTableView.Items) |
| { |
| item.Edit = true; |
| } |
| } |
| Private Sub MakeGraph(ByVal myyear As Int32, ByVal _Val1 As String, ByVal _val2 As String) |
| Dim table As DataTable |
| table = Get52WeekGraph |
| rctrend.DataSource = table |
| rctrend.DataBind() |
| rctrend.PlotArea.XAxis.DataLabelsColumn = "weekname" |
| Dim series1 As New Telerik.Charting.ChartSeries() |
| Dim series2 As New Telerik.Charting.ChartSeries() |
| rctrend.Series.Clear() |
| Dim minval As Double = 1000000 |
| Dim maxval As Double = 0 |
| For Each rowView As DataRowView In table.DefaultView |
| Dim seriesItem1 As New Telerik.Charting.ChartSeriesItem() |
| seriesItem1.Label.Visible = False |
| If Not IsDBNull(rowView("tyval")) Then |
| seriesItem1.YValue = CDbl(rowView("tyval")) |
| If seriesItem1.YValue < minval Then minval = seriesItem1.YValue |
| If seriesItem1.YValue > maxval Then maxval = seriesItem1.YValue |
| series1.DataLabelsColumn = rowView("weekname") |
| End If |
| series1.AddItem(seriesItem1) |
| Dim seriesItem2 As New Telerik.Charting.ChartSeriesItem() |
| seriesItem2.Label.Visible = False |
| If Not IsDBNull(rowView("lyval")) Then |
| seriesItem2.YValue = CDbl(rowView("lyval")) |
| If seriesItem2.YValue < minval Then minval = seriesItem2.YValue |
| If seriesItem2.YValue > maxval Then maxval = seriesItem2.YValue |
| series1.DataLabelsColumn = rowView("weekname") |
| End If |
| series2.AddItem(seriesItem2) |
| Next |
| series1.Name = _Val1 |
| series2.Name = _val2 |
| Dim valdiff As Double |
| Dim mybuff As Double |
| Dim mystep As Double |
| valdiff = maxval - minval |
| mybuff = valdiff * 0.2 |
| minval = CInt(minval - mybuff) |
| maxval = CInt(maxval + mybuff) |
| mystep = (maxval - minval) / 10 |
| rctrend.Series.Add(series1) |
| rctrend.Series.Add(series2) |
| rctrend.PlotArea.Chart.DefaultType = Telerik.Charting.ChartSeriesType.Line |
| rctrend.PlotArea.YAxis.AutoScale = False |
| rctrend.PlotArea.YAxis.IsZeroBased = False |
| rctrend.PlotArea.YAxis.MinValue = minval |
| rctrend.PlotArea.YAxis.MaxValue = maxval |
| rctrend.PlotArea.YAxis.Step = mystep |
| rctrend.PlotArea.XAxis.MaxValue = 52 |
| rctrend.ChartTitle.TextBlock.Text = "Score" |
| End Sub |
Is there a way to add custom buttons to a RadListBox control? In addition to Delete and Reorder I need to add 3 more buttons for my custom actions. Also I might need to register those 3 new buttons with RadToolTipManager. Is this possible to do?
| <form id="form1" runat="server"> |
| <table width="100%" border="0" cellspacing="0" cellpadding="0"> |
| <tr> |
| <td align="left" valign="top" bgcolor="white"> |
| <div id="iControl" runat="server"> |
| </div> |
| </td> |
| </tr> |
| </table> |
| </form> |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| Control ctrl; |
| ctrl = this.LoadControl("testctrl.ascx"); |
| iControl.Controls.Add(ctrl); |
| } |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadScheduler1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" |
| Width="75px" Transparency="20"> |
| <table style="width: 100%; height: 100%; background-color: white;"> |
| <tr style="height: 100%"> |
| <td align="center" valign="middle" style="width: 100%"> |
| <img alt="Loading..." src='Icons/loading2.gif' style="border-right: 0px; border-top: 0px; |
| border-left: 0px; border-bottom: 0px" /> |
| </td> |
| </tr> |
| </table> |
| </telerik:RadAjaxLoadingPanel> |
| <telerik:RadScheduler runat="server" ID="RadScheduler1" Width="750px" SelectedView="WeekView" |
| TimeZoneOffset="00:00:00" DayStartTime="08:00:00" DayEndTime="18:00:00" ReadOnly="true" |
| DataKeyField="ID" DataSubjectField="Title" Skin="Office2007" DataStartField="DateStart" |
| DataEndField="DateEnd" OnClientAppointmentClick="OnClientAppointmentClick"> |
| <AdvancedForm Modal="false" /> |
| <TimelineView UserSelectable="false" /> |
| </telerik:RadScheduler> |
| <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server"> |
| <script type="text/javascript"> |
| function OnClientAppointmentClick(sender, eventArgs) { |
| alert(eventArgs.get_appointment().get_id()); |
| } |
| </script> |
| </telerik:RadCodeBlock> |