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

Scheduler height after initially being hidden

5 Answers 64 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 22 Aug 2011, 04:30 PM
Hi,
I have a scheduler that is initially hidden on my page.  After the user hits a button the data should be populated.

Technically it works fine and the data is shown BUT on the first load the height of the scheduler is normally set to about 108px.  I've hardcoded the height to be 550px and that doesn't fix this.  

Interestingly if I resize the page, reload the page, visit another page and then come back the problem doesn't reappear until the tab is closed and a new tab opened. This seems to be affecting all browsers but is most demonstrable in chrome and is easy to replicate in chrome.

Tomorrow I'll be creating a demo to solve this, in the meantime is there any obvious reason why this might be happening?

Regards,

Jon

5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 23 Aug 2011, 12:03 PM
Hi Jon,

You can try callinig the client repaint() method of RadScheduler in the client event that shows the control.
Here is how to find the client object of RadSchedler

var scheduler = $find(<%= RadScheduler1.ClientID %>);
scheduler.repaint();

Does this help?

Greetings,
Peter
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Jon
Top achievements
Rank 1
answered on 23 Aug 2011, 01:56 PM
Hi Peter,

No sadly that didn't work.

I put the repaint in the responsescripts of the ajaxmanager and same result as before.

Hopefully I'll have the time later to get this into a working (or rather not!) demo.

Regards,

Jon

0
Jon
Top achievements
Rank 1
answered on 26 Aug 2011, 11:02 AM
Hi Peter,

OK this is definitely a bug in the control.  At the bottom of this post is the stripped down code from my page and the code behind. Basically I want the scheduler to be initially hidden from view and I think that setting visible = false is causing the issue, take out the visible=false from the code below and the height is correct.  To duplicate this follow the steps below:

Start the code running, then from Chrome (important to use chrome as it's consistent) load the page.  Initially the page will just show an OK button, press it, you will see the scheduler but it isn't the height it should be, now resize the page or press OK again.  This time the scheduler should goto the correct size.  If you refresh the page it still works properly but create a new tab in chrome, load the page in that and the problem comes back.  So it is only on first load of page but it's very annoying.

For some reason on IE the appearance is much more erratic, disturbingly in a way IE seems to be remembering something until it is fully closed down.

Anyway please could you let me know a work around and also confirmation that this is a bug and will be resolved in an upcoming release?

Many Thanks,

Jon.

ASPX:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server"></telerik:RadStyleSheetManager>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
    <div>
    <telerik:RadButton ID="uxSubmitButton" runat="server" UseSubmitBehavior="false" Text="OK"><Icon PrimaryIconUrl="/Images/Icons/16/copy.png" PrimaryIconLeft="6px"></Icon></telerik:RadButton>  
        <telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="EndDate"
            DataKeyField="MeetingID" DataSourceID="SqlDataSource" Height="542px"
            DataStartField="StartDate" DataSubjectField="Description" Visible="false">
        </telerik:RadScheduler>
    </div>
    <telerik:RadAjaxManager runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>       
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="uxSubmitButton">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <asp:SqlDataSource ID="SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:AmonetConnectionString %>" SelectCommand="usp_MEE_MeetingsSelect" SelectCommandType="StoredProcedure" >
    <SelectParameters><asp:Parameter Name="MeetingLocations" DbType="String" DefaultValue="6" /></SelectParameters>
    </asp:SqlDataSource>
    </form>
</body>
</html>


Code Behind
Public Partial Class WebForm2
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
    End Sub
 
    Private Sub uxSubmitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles uxSubmitButton.Click
        RadScheduler1.Visible = True
    End Sub
End Class


0
Jon
Top achievements
Rank 1
answered on 31 Aug 2011, 11:39 AM
Hi,
Any pointers on this one? - Resolution getting urgent.
Regards,
Jon
0
Accepted
Plamen
Telerik team
answered on 31 Aug 2011, 01:24 PM
Hi Jon,

Would you please instead of setting the Visible="false" in the beginning just set Height="0px" and  the Width="0px" and after that set the desired height and width in the click event. This worked as expected in every browsers at my side.

Hope this is helpful.

Kind regards,
Plamen Zdravkov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Scheduler
Asked by
Jon
Top achievements
Rank 1
Answers by
Peter
Telerik team
Jon
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or