Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
117 views
I have a tooltip manager on my page that has 2 dropdowns and a textbox on it.  When the user clicks an edit button I display the tooltip and load the controls.  This works great the first time the button is clicked. However if the user closes the tooltip and clicks a second edit button on the page the tooltip shows with the information from the original item.  I have stepped through the code and it shows that the values of the controls are being set correctly all the way throughout.  However it doesn't seem that the actual controls are being updated on the page.  I would appreciate any help anyone could provide.

        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.  
        } 
Landon Martin
Top achievements
Rank 1
 answered on 18 Nov 2009
2 answers
194 views
I have a ToolTipManager on  a page when a button is clicked loads a UserControl based off of which item is clicked.  In this particular instance it has two dropdowns and a textbox.  It also has a save button.  The problem I am having is that I cannot get any event to trigger inside the tooltip.  When I click my save button the OnAjaxUpdate event fires but the button click event does not.  Here is what I have codewise:
In my page:
<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> 

The user control:
<%@ 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" /> 
Here's the code AjaxCode:
        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();  
        } 

The code in SaveInfo is irrelevant because SaveClicked is not even firing! A huge thank you in advance for any help I can get as I'm pushing deadline.
Landon Martin
Top achievements
Rank 1
 answered on 18 Nov 2009
3 answers
128 views
Hi,

I have a grid with couple of columns, but only column with check box is editable. I want that editable column in edit mode all the time.

With the following code, whenever the page postbacks, editable column turns into non-editable.
protected void grdAnnouncements_PreRender(object sender, System.EventArgs e) 
        { 
            foreach (GridItem item in grdAnnouncements.MasterTableView.Items) 
            { 
                item.Edit = true;                
            }                         
        } 
 
 

Any help is appreciated.

Veshala
Top achievements
Rank 1
 answered on 17 Nov 2009
4 answers
204 views
I have a line chart with 2 series.  series1 will always have less values than series2.   The last value of series1 causes the line do drop to the x axis, I would like it to just end.

  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 
d with the last real value. 
Schlurk
Top achievements
Rank 2
 answered on 17 Nov 2009
1 answer
208 views
I have a RadListBox that is filled in the code behind when the SelectedIndex of a RadDropDown is changed.  On the same screen is  a button the will open a rad window that will allow the user to edit the information that is show in the RadListBox.  I am trying to set up client side script that will reload the RadListBox when the RadWindow is closed.  There does not seem to be a set_datasource.  Is there anyway to do this?
Schlurk
Top achievements
Rank 2
 answered on 17 Nov 2009
3 answers
178 views
Im editing using advancetemplate with a user control who binds the properties (start, end, subject and id).

In the updatecommand event i can see the appointment and modified appointment has changed accordingly.  but the radscheduler doesnt get refreshed.

btw im using radajaxmanager indicating the radscheduler.

any hints in this?
robertw102
Top achievements
Rank 1
 answered on 17 Nov 2009
3 answers
339 views

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?

Orest
Top achievements
Rank 1
 answered on 17 Nov 2009
1 answer
94 views
Hi

My problem is when Scheduler loads then i can click only once then after that on 2nd time click showing like test.aspx# and i cannot click on any button of RadScheduler after once.

I am adding User Controls dynamically its my requirement like

test.aspx

<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> 
cs
  protected void Page_Load(object sender, EventArgs e) 
    { 
        Control ctrl; 
        ctrl = this.LoadControl("testctrl.ascx"); 
        iControl.Controls.Add(ctrl); 
 
    }    
 

user control

<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> 
 



Muhammad Imran
Top achievements
Rank 1
 answered on 17 Nov 2009
34 answers
2.3K+ views
Hi. I have a new machine with a fresh install of Vista and VS2008. I just auto-installed Prometheus 2007.31218.

I start a new Web site in .NET Framework 3.5 and also manually add Telerik.Web.Design.dll from the Bin35 folder to my project's bin folder.

The Prometheus controls are already in the toolbox from auto-install, so I try to add them to a Web page. For some (RadMenu) I get a 'Failed to create designer' error. For others (RadGrid), I get Could not load file or assembly 'Telerik.Web.UI, Version=2007.3.1218.35'.

Perhaps there is a step that I overlooked? Please help.
Craig Morgan
Top achievements
Rank 1
 answered on 17 Nov 2009
4 answers
203 views
Hi,

I have this horizontal rule behavior in some of my dropDowns (that inherit RadComboBox)

(2009-11-17_1003.png: image attached)

The tab position is weird as well, as if I use Telerik.Web.UI.dll v.2008.03.1125.20 it shows fantastic!
if I use Telerik.Web.UI.dll v.2009.02.826.2 it shows half the way :(

(2009-11-17_1015.png: 2nd image attached so you see how it shows in the older version)

a simple screen cast to shown the Dropdows.
url: http://bit.ly/jpgK3

you can see by the code (using Firebug) that there is no spaces in the numeric dropdowns, but it gives me an annoying horizontal scroll...

This is a dynamic load, so there is no control code, only adding controls dynamically to a Panel and render them in a webpage.
The code that loads the DropDown controls is exactly the same for all dropdowns you can see in the video, but some act very differently, why?
Simon
Telerik team
 answered on 17 Nov 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?