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

Postback Selection

7 Answers 92 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 09 Jun 2011, 08:47 PM
Hi sorry I think I posted about this a while ago, but I can't find it (or the resolution)

http://screencast.com/t/mcJ4tM7K8tGK

The client state of the control remembers the selected dates, but once it re-renders after a postback none of the <td> tags have the rcSelected class applied...I have to hover-over the element to get it to show back up.

7 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 14 Jun 2011, 07:34 AM
Hello Steve,

This happens because Firefox caches the values of the <input> elements where RadCalendar keeps its state (selected dates, focused date, etc.). As a work around you can manually clear the selected dates from the calendar, for example on the client-side Load event of the control:

ASPX:
<telerik:RadCalendar ID="RadCalendar1" runat="server" ClientEvents-OnLoad="clearSelection" />

JavaScript:
function clearSelection(sender, eventArgs) {
            var calendar = sender;
            var dates = calendar.get_selectedDates();
            for (var i = 0; i < dates.length; i++) {
                var date = dates[i];
                calendar.unselectDate(date);
            }
        }

And if the dates are actually checked you could loop thought calendar's cells and change their styles. Or use the OnDayRender client event for setting the styles.

Greetings,
Vasil
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 14 Jun 2011, 02:50 PM
Is this not a bug then?...I don't know of any other control in this suite that I have to manually go in and clear out values which shouldn't be set.

Can you guys internally just not do this

$telerik.isFirefox then run the code below?

I mean I'd have to remember to do this on literally EVERY radcalendar I use...and that sucks :(
0
Vasil
Telerik team
answered on 15 Jun 2011, 11:45 AM
Hi Steve,

I was able to reproduce the problem when refreshing the page in Firefox using the reload button(or hitting F5), we will do further research on what exactly causes the problem and we will fix it if it is possible.

However, making regular PostBack doesn't trigger such an issue on my side. For example if I add a calendar and a button for making a PostBack and then select some values and click the button. After the page loads selected dates will have selected style applied. Could you show us the code that you used in your demonstration for helping us to reproduce the same issue?

All the best,
Vasil
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 15 Jun 2011, 05:30 PM
Not much to it really... :)

<ul>
    <li>
        <h6>Standard</h6>
        <telerik:RadCalendar ID="RadCalendar2" runat="server" DbSelectedDate='<%= DateTime.Now %>'  />
    </li>
    <li>
        <h6>No Week Row</h6>
        <telerik:RadCalendar ID="RadCalendar3" runat="server" ShowRowHeaders="false" />
    </li>
    <li>
        <h6>Multi Month</h6>
        <telerik:RadCalendar ID="RadCalendar1" runat="server" MultiViewColumns="2" MultiViewRows="2" />
    </li>
</ul>

..and here's my skin

<telerik:RadCalendar runat="server" Skin="Medportal" EnableEmbeddedSkins="False" DayNameFormat="Short"  ShowRowHeaders="false" />
0
Vasil
Telerik team
answered on 20 Jun 2011, 01:08 PM
Hello Steve,

We still can't replicate the problem in sample page using regular post-back. Check this video and the attached web site. If you are able to reproduce it in this page, please feel free to do some modifications of the code and send it back to us to continue further debugging on our side.

All the best,
Vasil
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 20 Jun 2011, 04:14 PM
Here, using teleriks own demo site :)

http://screencast.com/t/CHth8jhl

Shows the calendar selection being gimpy after a refresh, but the RadGrid handles it properly
0
Vasil
Telerik team
answered on 21 Jun 2011, 07:50 AM
Hi Steve,

Thank you the effort to providing us a feedback. As I mentioned before, we are aware that this issue occurs when using F5 or refresh button and our developers are researching if there is any way of solving this problem that happens only in Firefox. I was asking if you observed such an issue when PostBack using a button in the page.

Greetings,
Vasil
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Calendar
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Vasil
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or