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

[Solved] Can't make linkbutton invisible

2 Answers 155 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 22 Nov 2007, 03:35 PM
Hi, I'm using scheduler and I have placed a linkbutton within a div on the page to appear at the bottom of the scheduler. The aspx code for this is:

<div id="outlookWrapper">  
                <h1><asp:Label runat="server" ID="patientsName"></asp:Label></h1>  
                <div id="outlookLinkButton"><asp:LinkButton ID="lbChangeSlots" runat="server"   
                        onclick="lbChangeSlots_Click">View by 15 min slots</asp:LinkButton></div>  
                <telerik:RadSplitter runat="server" ID="RadSplitter1" Height="535px" Width="576px" Skin="Web20" BorderSize="0">  
                <telerik:RadPane runat="server" ID="CalendarPane" MinWidth="200" Width="200px" CssClass="calendarPane">     
                          
                        <telerik:RadCalendar ID="RadCalendar1" runat="server" AutoPostBack="true"   
                            DayNameFormat="FirstTwoLetters" EnableMonthYearFastNavigation="false"   
                            EnableMultiSelect="false" EnableNavigation="true"   
                            OnDefaultViewChanged="RadCalendar1_DefaultViewChanged"   
                            OnSelectionChanged="RadCalendar1_SelectionChanged" ShowRowHeaders="false"   
                            Skin="Office2007">  
                        </telerik:RadCalendar> 
                          
<p></p>  
                          
                          
                          
                        <telerik:RadCalendar ID="RadCalendar2" runat="server" AutoPostBack="true"   
                            DayNameFormat="FirstTwoLetters" EnableMonthYearFastNavigation="false"   
                            EnableMultiSelect="false" EnableNavigation="false"   
                            OnSelectionChanged="RadCalendar2_SelectionChanged" ShowRowHeaders="false"   
                            Skin="Office2007">  
                        </telerik:RadCalendar> 
                          
<p></p>  
                          
                          
                          
                        <telerik:RadCalendar ID="RadCalendar3" runat="server" AutoPostBack="true"   
                            DayNameFormat="FirstTwoLetters" EnableMonthYearFastNavigation="false"   
                            EnableMultiSelect="false" EnableNavigation="false"   
                            OnSelectionChanged="RadCalendar3_SelectionChanged" ShowRowHeaders="false"   
                            Skin="Office2007">  
                        </telerik:RadCalendar> 
                          
<p></p></telerik:RadPane> 
                <telerik:RadSplitBar runat="server" id="RadSplitBar1" BorderWidth="0" /> 
                <telerik:RadPane runat="server" ID="SchedulerPane" CssClass="schedulerPane" MinWidth="554" Width="554px">  
                      
                      
                <telerik:RadScheduler ID="RadScheduler1" runat="server" AllowDelete="False"   
                        AllowEdit="false" DataEndField="ObservationDate" DataKeyField="MessageID"   
                        DataSourceID="GetCalendarViewDataSource" DataStartField="ObservationDate"   
                        DataSubjectField="TextDescription" EnableEmbeddedSkins="True" Height="557px"   
                        MinutesPerRow="30" OnAppointmentClick="RadScheduler1_AppointmentClick"   
                        OnNavigationComplete="RadScheduler1_NavigationComplete"   
                        OverflowBehavior="Expand" ReadOnly="true" SelectedView="DayView"   
                        ShowAllDayRow="false" Skin="Office2007" StartInFullTime="True"   
                        TimeLabelRowSpan="2" TimeZoneOffset="03:00:00" WorkDayEndTime="18:00:00"   
                        WorkDayStartTime="08:00:00">  
                    </telerik:RadScheduler> 
                      
</telerik:RadPane> 
            </telerik:RadSplitter> 
        </div> 

3rd line down is my link button. In the code behind on change of view i.e. (day, week, month) I have the following C# code:

/// <summary>  
        /// test  
        /// </summary>  
        /// <param name="sender"></param>  
        /// <param name="e"></param>  
        protected void RadScheduler1_NavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e)  
        {  
            switch (e.Command.ToString())  
            {  
                case "SwitchToDayView":  
                    {  
                        lbChangeSlots.Visible = true;  
                        break;  
                    }  
                case "SwitchToWeekView":  
                    {  
                        lbChangeSlots.Visible = true;  
                        break;  
                    }  
                case "SwitchToMonthView":  
                    {  
                        lbChangeSlots.Visible = false;  
                        break;  
                    }  
                default:  
                    {  
                        break;  
                    }  
            }  
 
            RadCalendar1.FocusedDate = RadScheduler1.SelectedDate;        
            SyncCalendars();  
        } 

The event is fired and it falls into the appropriate case statement, and if I interrogate the linkbutton at runtime in debug mode it tells me the state of the linkbutton has changed appropriately. However when I do click on month view, although it does go through all the motions and appears to be correctly set as not visible, when the page renders the linkbutton still displays. Any ideas?

Regards
Mike

2 Answers, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 22 Nov 2007, 04:08 PM
Just to clarify, although my code targets the RadScheduler1_NavigationComplete event, I also have the same logic within the event 

RadScheduler1_NavigationCommand, only this never seems to get fired, so that doesn't seem to be of use to me.

Regards
Mike

0
Peter
Telerik team
answered on 23 Nov 2007, 04:18 PM
Hello Mike,

We did a test project based on your description but everything worked fine. We tested for both NavigationCommand and NavigationComplete event and in both cases the link button disappeared when switching to MonthView. Can you open  a support ticket and send us a simple project which replicates the problem. We will test it locally and hopefully find what's causing the problem.


Greetings,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
Mike
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Peter
Telerik team
Share this question
or