This is a migrated thread and some comments may be shown as answers.

Multiple Rad Calendar cntrls in user cntrl on dynamically created PageView

1 Answer 51 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Jacques
Top achievements
Rank 1
Jacques asked on 20 Aug 2008, 03:03 PM
I have a RadTimePicker control in a user control (ascx). When this is the only RadCalendar type control it works correctly. When a RadDatePicker is added to the user control, neither the TimePicker or DatePicker work (No popup).

The controls are within a dynamically created pageview.

We've attempted to use a shared calendar and Timeview control to no avail. We tried adding these controls to the ascx page and to the aspx page. Neither worked.

Would greatly appreciate any help in getting multiple controls to work is this scenario.

Thanks

Jacques

aspx segment of page which uses a master
<asp:Panel ID="pnlPreferences" runat="server" GroupingText="">  
    <table border="0">  
        <tr> 
            <td align="center">  
                 <telerik:RadTabStrip OnClientTabSelecting="onTabSelecting" ID="rtsDonorView" SelectedIndex="0" 
                    runat="server" MultiPageID="rmpDonorView" AutoPostBack="true"   
                    Orientation="HorizontalTop">  
                </telerik:RadTabStrip> 
                <telerik:RadMultiPage ID="rmpDonorView" runat="server" SelectedIndex="0" RenderSelectedPageOnly="true" > 
                </telerik:RadMultiPage>             
            </td> 
        </tr> 
      
    </table> 
</asp:Panel> 
 

partial code behind for aspx page
   Protected Overrides Sub OnLoadNonPostBack()  
        MyBase.OnLoadNonPostBack()  
 
        'TODO Add error checking and recovery to handle case that no DonorInformationID is supplied.  
        If Request("DonorInformationID") Is Nothing Then  
            'Throw New Exception("DonorInformationID must be supplied")  
        End If  
 
        '*******************************************************************************  
        '** hidden fields are losing their values when a tab is clicked.              **  
        '** Storing as viewstate in properties retains the values between tab selections  
        '*******************************************************************************  
        'hfDonorInformationID.Value = Request("DonorInformationID")  
 
        DonorInformationID = 1 'TODO Testing. Hidden fields are losing their values when a tab is clicked. Testing viewstate  
        PersonID = ent.DonorInformation.Include("Person") _  
            .GetByPk(DonorInformationID).Person.PersonID  
 
        AddTab("Donor Summary", "DonorSummary.ascx")  
        AddPageView(rtsDonorView.FindTabByValue("DonorSummary.ascx"))  
        AddTab("Donation History", "DonationHistory.ascx")  
        AddTab("Contact History", "ContactHistories.ascx")  
        AddTab("Campaigns", "Campaigns.ascx")  
        rtsDonorView.FindTabByValue("Campaigns.ascx").IsBreak = True 
 
        AddTab("Contact Information", "ContactInformation.ascx")  
 
        AddTab("Preferences", "Preferences.ascx")  
        AddTab("Concerns", "Concerns.ascx")  
 
        AddTab("Household", "Household.ascx")  
 
        Dim sTemplate = (From q In ent.Template _  
                       Where q.TemplateType.TemplateTypeID = 4 _  
                       Select q.Value _  
                       ).FirstOrDefault()  
 
        lblViewTemplate.Text = Utility.TemplateProcessing.ProcessTemplate(sTemplate, PersonID)  
    End Sub  
 
 
    Protected Sub rmpDonorView_PageViewCreated(ByVal sender As Object, _  
                                               ByVal e As RadMultiPageEventArgs) _  
                                               Handles rmpDonorView.PageViewCreated  
        Dim userControlName As String = e.PageView.ID  
        Dim userControl As DonorViewTab = Page.LoadControl("DonorViewControls/" & userControlName)  
        userControl.DonorInformationID = DonorInformationID  
        userControl.PersonID = PersonID  
        userControl.ID = e.PageView.ID & "_userControl"  
         e.PageView.Controls.Add(userControl)  
    End Sub  
 
    Protected Sub rtsDonorView_TabClick(ByVal sender As Object, _  
                                        ByVal e As RadTabStripEventArgs) _  
                                        Handles rtsDonorView.TabClick  
 
        If e.Tab.PageViewID.ToString = "" Then  
            AddPageView(e.Tab)  
        End If  
        e.Tab.PageView.Selected = True 
    End Sub  
 
    Private Sub AddTab(ByVal tabName As String, ByVal tabID As String)  
        Dim tab As RadTab = New RadTab  
        tab.Text = tabName 
        tab.Value = tabID 
        rtsDonorView.Tabs.Add(tab)  
    End Sub  
 
    Private Sub AddPageView(ByVal tab As RadTab)  
        Dim pageView As RadPageView = New RadPageView  
        pageView.ID = tab.Value  
        rmpDonorView.PageViews.Add(pageView)  
        tab.PageViewID = pageView.ID  
    End Sub  
 

partial code for ascx user control
     <tr> 
        <td align="right"><asp:Label ID="lblTime" runat="server" meta:ResourceKey="lblTime" CssClass="Label" /></td>  
        <td colspan="2" align="left">  
            <telerik:RadTimePicker ID="rtpCallPreference" runat="server"   
                Culture="English (United States)" SharedTimeViewID="RadTimeView1">  
                <TimePopupButton CssClass="" /> 
                <TimeView Interval="01:00:00">  
                </TimeView> 
                <DateInput LabelCssClass="" Width="">  
                </DateInput> 
                <Calendar UseColumnHeadersAsSelectors="True" UseRowHeadersAsSelectors="True">  
                </Calendar> 
                <DatePopupButton CssClass="" Visible="False" /> 
            </telerik:RadTimePicker> 
        </td> 
    </tr> 
        <tr> 
            <td align="right"><asp:Label ID="lblExpires" runat="server" meta:ResourceKey="lblExpires" CssClass="Label"></asp:Label> 
                  
            </td> 
            <td align="left">  
             <telerik:RadDatePicker ID="rdpExpires" Runat="server">  
                </telerik:RadDatePicker>     
            </td> 
        </tr> 
 

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 21 Aug 2008, 08:22 AM
Hello Jacques,

I created a small project following your scenario but was not able to replicate the described issue locally. Will it be convenient for you to open a regular support ticket and send us sample runnable project which replicates the problem. We will test it locally and provide accurate solution for the issue you are facing.

Regards,
Maria Ilieva
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Calendar
Asked by
Jacques
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or