Showing posts with label rendering. Show all posts
Showing posts with label rendering. Show all posts

Wednesday, March 21, 2012

CalendarExtender Rendering Problems

Hello,

I'm experiencing some rendering glitches with the CalendarExtender control. The calendar doesn't fit within the panel that it renders. For instance, one of my calendars shows only Sunday-Friday, while another shows only Sunday-Wednesday. There are some other minor glitches when I navigate to different levels. This seems to depend on the padding of the parent control.

I temporarily disabled my theme, and everything works fine, but reapplying the theme reintroduces the problem. I've tried adding the .ajax__calendar styles to my theme with no noticeable effect.

Thanks in advance.

Hi rmuti,

what if you add a cssclas to your calendar extender?

use css class MyCalendar,

 <style type="text/css"> .MyCalendar .ajax__calendar_container { border:1px solid #646464; background-color: lemonchiffon; color: red;}.MyCalendar .ajax__calendar_other .ajax__calendar_day,.MyCalendar .ajax__calendar_other .ajax__calendar_year { color: black;}.MyCalendar .ajax__calendar_hover .ajax__calendar_day,.MyCalendar .ajax__calendar_hover .ajax__calendar_month,.MyCalendar .ajax__calendar_hover .ajax__calendar_year { color: black;}.MyCalendar .ajax__calendar_active .ajax__calendar_day,.MyCalendar .ajax__calendar_active .ajax__calendar_month,.MyCalendar .ajax__calendar_active .ajax__calendar_year { color: black; font-weight:bold;} </style>

Please let me know if this helps ;)

Wim


Nope, that just makes things worse. Now the calendar is transparent for some reason.


damn maybe I gave you the wrong example,

but thats just because not all the styles are applied ...

The real issue was that not all the dates were shown right?
And now they are? Or not?

If this is the case, then we can just ajust the style-tags and you're problem is solved!

Kind regards,
Wim


Nope, Saturday is still cut off.


rmuti:

Nope, Saturday is still cut off.

Hmm, could you replicate this behavior in an example? That way I can look into the problem myself.

Kind regards,
Wim


Hi Rmuti,

Please remove the CSS settings that you added to the CalendarExtender manually and also you should remove the unnecessay parts, then have a test. If the problem is still there, please adjust your time zone. If all these don't work, we suggest that you should download a sample fromhttp://www.asp.net/learn/ajax-videos/ and test the sample. If the sample also doesn't work, you should focus on your system enviroments. For example, Microsoft ASP.NET AJAX Extensions , AJAX Control Toolkit's version etc.

Please feel free to let me know with more information. Sometimes , we really need a workable sample to find out the exact root cause.

Best regards,

Jonathan


OK, I've identified the cause of the issue. The calendar renders the days/months/years in a table, but does not specify the padding for the table cells. As a result, if you place the calendar within a table cell with padding, then the calendar table will inherit the padding from the parent table cell. Here is a simple page that will reproduce the issue:

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title> <style type="text/css"> table.myTable tr td { padding: 20px; } </style></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <table class="myTable"> <tr> <td>Date:</td> <td> <asp:TextBox ID="dateTextbox" runat="server" /> <ajaxToolkit:CalendarExtender ID="dateCalendar" runat="server" TargetControlID="dateTextBox" /> </td> </tr> </table> </form> </body></html>
I've been able to resolve the issue by explicitly specifying the padding for the calendar table as follows:
 
<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title> <style type="text/css"> table.myTable tr td { padding: 20px; } .ajax__calendar_body table tr td { padding: 0px; } </style></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <table class="myTable"> <tr> <td>Date:</td> <td> <asp:TextBox ID="dateTextbox" runat="server" /> <ajaxToolkit:CalendarExtender ID="dateCalendar" runat="server" TargetControlID="dateTextBox" /> </td> </tr> </table> </form> </body></html>

Hi Rmuti,

In the first situation, table.myTable tr td { padding: 20px; } has an impact on the CalendarExtender. Thanks for sharing your experience.

Best regards,

Jonathan


Thanks to this post I my calendar renders correctly BUT I am missing hover background shading
has anyone got any ideas what to add and where to get these back? I know they are being overidden by something but I don't know what...

.MyCalendar.ajax__calendar_container {border:1pxsolid#646464;background-color:#10377c;color:#ffffff;font-size:8pt;font-family:Verdana,'Colonna MT';}

.MyCalendar.ajax__calendar_bodytabletrtd {padding:0px;color:#10377c;background-color:#ffffff;}

Missing Hover

CalendarExtender rendering on a page with a large TabContainer

Very strange issue here. I have a page with embedded Tabcontainers and a CalendarExtender. When I click on the Textbox bound to the CalendarExtender it does not display properly. I get no forward/back arrows to scroll months, and if I click on the month name, panels start flying around as opposed to the scrolling behavior that should be experienced.

I've been gradually removing items from my page to try to isloate the problem, and have trimmed things to the attached file. From here, if I delete any one of the TabPanel items, the calendar will render properly. Put it back, and it's messed up again. Additionally, if I move the CalendarExtender above the TabPanel, it renders properly as well. This won't work for my solution, however.

Any insight on what is causing the problem?

/* test.aspx ******************************************************/

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="info_test" Title="Untitled Page" %>
<%@dotnet.itags.org. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<%@dotnet.itags.org. Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Test</title>
</head>
<body >
<form runat="server" id="frmMP" >
<asp:ScriptManager ID="scmMain" EnablePartialRendering="true" runat="server" />
<ajax:tabcontainer runat="server" ID="tbcMain">
<ajax:TabPanel runat="server" ID="tplMain1" HeaderText="Main1" >
<ContentTemplate>
<ajax:tabcontainer ID="tplSub1" runat="server">
<ajax:TabPanel runat="server" ID="tplSub1_1" HeaderText="Sub1_1"/>
<ajax:TabPanel runat="server" ID="tplSub1_2" HeaderText="Sub1_2"/>
<ajax:TabPanel runat="server" ID="tplSub1_3" HeaderText="Sub1_3"/>
<ajax:TabPanel runat="server" ID="tplSub1_4" HeaderText="Sub1_4"/>
<ajax:TabPanel runat="server" ID="tplSub1_5" HeaderText="Sub1_5"/>
<ajax:TabPanel runat="server" ID="tplSub1_6" HeaderText="Sub1_6"/>
<ajax:TabPanel runat="server" ID="tplSub1_7" HeaderText="Sub1_7"/>
</ajax:tabcontainer >
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="tplMain3" HeaderText="Main3">
<ContentTemplate>
<ajax:tabcontainer ID="tplSub3" runat="server">
<ajax:TabPanel runat="server" ID="tplSub3_1" HeaderText="Sub3_1" />
<ajax:TabPanel runat="server" ID="tplSub3_2" HeaderText="Sub3_2" />
<ajax:TabPanel runat="server" ID="tplSub3_3" HeaderText="Sub3_3" />
<ajax:TabPanel runat="server" ID="tplSub3_4" HeaderText="Sub3_4" />
<ajax:TabPanel runat="server" ID="tplSub3_5" HeaderText="Sub3_5" />
<ajax:TabPanel runat="server" ID="tplSub3_6" HeaderText="Sub3_6" />
</ajax:tabcontainer >
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="tplMain4" HeaderText="Main4">
<ContentTemplate>
<ajax:tabcontainer ID="tplSub4" runat="server">
<ajax:TabPanel runat="server" ID="tplSub4_1" HeaderText="Sub4_1" />
<ajax:TabPanel runat="server" ID="tplSub4_2" HeaderText="Sub4_2" />
<ajax:TabPanel runat="server" ID="tplSub4_3" HeaderText="Sub4_3" />
<ajax:TabPanel runat="server" ID="tplSub4_4" HeaderText="Sub4_4" />
<ajax:TabPanel runat="server" ID="tplSub4_5" HeaderText="Sub4_5" />
<ajax:TabPanel runat="server" ID="tplSub4_6" HeaderText="Sub4_6" />
<ajax:TabPanel runat="server" ID="tplSub4_7" HeaderText="Sub4_7" />
<ajax:TabPanel runat="server" ID="tplSub4_8" HeaderText="Sub4_8" />
<ajax:TabPanel runat="server" ID="tplSub4_9" HeaderText="Sub4_9" />
<ajax:TabPanel runat="server" ID="tplSub4_10" HeaderText="Sub4_10" />
<ajax:TabPanel runat="server" ID="tplSub4_11" HeaderText="Sub4_11" />
</ajax:tabcontainer >
</ContentTemplate>
</ajax:TabPanel>
</ajax:tabcontainer>
<asp:TextBox ID="txtA" runat="server"/>
<ajax:CalendarExtender ID="ceCal" runat="server" TargetControlID="txtA" CssClass="MyCalendar"/>
</form>
</body>
</html>

Hi,

Wow... this is bizarre. Our current best guess is that it looks like IE will only load the first 32 <link> tags at the top of the page. Currently if you use the default tab style, it's adding a <link> for each tab/panel/etc. and the <link> for the Calendar's style is the 33rd (which is why moving the calendar above the tabs fixes the problem). As a quick workaround I'd recommend you not use the default style (i.e. copy the default style into your page, give it a different name, etc.) to prevent tabs from loading that many links. I'll open a work item to see what we can do from our end to not load duplicate <link>s.

Thanks,
Ted


Hi,

Here's thework item.

Also, there's an even quicker work around. Just move the CalendarExtender above the tabs. Your textbox can stay in the same place so your page looks fine, but the Calendar will be processed first.

Thanks,
Ted


Workaround works perfectly. Thanks for your assistance, Ted!

Yes