.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Calender control. Displaying important dates.

Posted By:      Posted Date: September 18, 2010    Points: 0   Category :ASP.Net
I have a calender control tht you can click on. When you click on a date you see all the events that happens that date. But i want the calender to show what dates have events. I want these dates to have a seperate styling. In the code behind i catch the DayRender event. I have a list will all important dates called "eventDates".   if (eventDates.Contains(e.Day.Date) == true)         {             Calendar1.SelectedDates.Add(e.Day.Date);                       }   if (eventDates.Contains(e.Day.Date) == true)        {            Calendar1.SelectedDates.Add(e.Day.Date);                     }Ive stepped through this method and its triggered once for every day of the month and the dates are addes succesfully. Ive also changed the SelcetedDates property in the mark up, like this: <SelectedDayStyle BackColor="AliceBlue" BorderColor="Red" />But nothing happens. I was hopping that the important dates in the calender would turn into blue background with red borders. I know its sounds horrible but i just wanted to really see if i could make it work. But as i said, nothing ha

View Complete Post

More Related Resource Links

Calender control to display dates of one month only

How to make calender control to display dates of one month only like for month of June it shows 25 to 31 of May and 1 to 5 of July. like this-   25 26 27 28 29 30 31 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 5   I want it to be displayed like this- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30   Any ideas

Hiding other month dates in ASP .Net Calendar Control

Often we need ASP .Net calendar control in our webpages. Most of the times we require navigation in between dates of the calendar control but there can be a requirement that when we want that users should not be able to select dates from month other than the current month.Some people might be thinking in mind that Microsoft has provided theShowNextPrevMonth property of a calendar control which can be set to false in order to disable the navigation in between months. Ok, this will disable navigation but what about the dates of adjacent months shown in current month?Following is the output of a normal Calendar control when ShowNextPrevMonth is not set to false.Note the red circles in above image. July and September will allow you to navigate through other months and red circles below will allow you to select dates of adjacent months.Ok now we set the ShowNextPrevMonth property to false and see the output. Following is the output in this case.So setting out the ShowNextPrevMonth property has disabled the July and Septemberlinks but dates of adjacent months are still there which can be selected as well. How to disable/hide these? Unfortunately there is no such default property provided using which one can disable or hide these dates but fortunately doing this using code is not a complex task. Use following code a

Displaying a System.Drawing.Bitmap in a WPF Image control

How would I convert a System.Drawing.Btimap into a comparable WPF image control so I can display in on my WPF window? Thanks

Displaying XML in label control using xslt formatting

I am using an XML file as a database and I am using a text box and a button to search for a node within the xml file and display that node on a label control using the format required by the xslt file.  I have created an example to use as the real file is rather big. If I add an xml control to the page and set the documentSource and transformSource to my existing files, it will display the node on the page in the correct format.  If I try and pass the query to the label, it only shows the inner text of the XML tags with no spaces and no formatting as specified in the xslt file. Is there a way to pass the query to a label control and render it using the formatting specified in the xslt file?  In all honesty, it doesn't even have to be a label if I can get the query to render as specified in the xslt file in any way shape or form, I would be happy with that.I feel like I am just one statement away from having it complete but for the life of me can't seem to figure out what it is.  Any help is apprecaited.XML File:<?xml version="1.0" encoding="utf-8" ?><?xml-stylesheet type="text/xsl" href="animal.xslt"?><animals>    <animal name="dog">        <color>brown</color>        <hair>lo

Problem displaying Date from Sql table on Calendar Control

Hi, I am displaying Event dates from SQL table on Calendar Control in ASP.NET. Also, I have GridView Control which shows event details when certain date is clicked on calendar control. But I have a problem as not all dates are displaying properly. Strangly enough only dates which have same month and day date are displayed. For example: It shows ok dates such as 08/08/2010, 09/09/2010, 10/10/2010 etc. If I click on the date which in SQL table exists as 11/25/2010 or 12/15/2010 etc (no matching month/day numbers) it shows error message saying: "System.Data.SqlClient.SqlException: Conversion failed when converting date and/or time from character string."  Follwoing is my code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.Sql; using System.Runtime.Remoting.Messaging; using System.Configuration; using System.Data.SqlClient; using System.Data; using System.Drawing; public partial class Test_Calendar : System.Web.UI.Page { SqlConnection mycn; SqlDataAdapter myda; DataSet ds = new DataSet(); DataSet dsSelDate; String strConn; private void Page_Load(object sender, System.EventArgs e) { strConn = "Data Source=mydatasource;Initial Catalog=DBname;Persist Security I

Ajax Control Toolkit - ModalPopup displaying behind Flash

HiI have a flash on my page and I need to popup an ajax window, I use ModalPopupExtender. The problem is that ajax popup window always shows behind the flash in Internet explorer and Google Chrome. In firefox there are no such problem.I tried to set wmode="transparent" but id didn't help.Thanks

Graphs stop displaying in Report Viewer Control after upgrade to SSRS 2008 R2

We are seeing an issue where certain graphs and guages are not being displayed within a report rendered in the report viewer control after we upgraded from SSRS 2008 to SSRS 2008R2.  You can see the graphs and guages render and then disappear from the screen when two other graphs are rendered.  When I export the report to Excel or PDF then all of the graphs and guages are rendered properly. There are a total of 3 graphs and 2 guages on the report - when it completes the rendering process, you can only see two of the graphs displayed in the report viewer control - as I said before, you can see all 3 graphs and 2 guages when exporting to Excel or PDF.  Using Internet Explorer v8.  This problem manifest itself right after the upgrade. Has anyone seen a similar issue? 

ajax calender control

i want to disable the last day and last month dates in this control????

Bind Data to a Calender Control

I have a data on my Standby _ Table look like this in database   ID EMP_NO YEAR MONTH DAY 3 10001 2010 09 17 4 10002 2010 09 18 5 10002 2010 09 19   Now I want have this data displayed in a form of a Calendar , actually a full page calendar. My senario is I have employees doing standby weekly but I want to have their standby dates displayed in a form of a calendar , can somebody please help me even if it means I have to change the table structure.   Im using a VS2008 .NET 3.5 Regards,      

Displaying the Rating (Star) Scale Control for a list item.

Is there anyway to display the star rating control? I'm trying to build an application page that displays list items and their associated rating control. I can count the amount of ratings using the SocialRatingManager...?

ASP.NET Calender control

I am starting doing my website project with ASP.NET Calender control, and i have encounter a problem in specify day that user can selec. In scenario 1, user cannot select weekend. As scenario 2, user can only select Tuesday and Thursday only for every month , any suggestions/ideas to implement it ?scenario 1protected void Calendar1_DayRender(object sender, DayRenderEventArgs e) { if (e.Day.IsWeekend || e.Day.Date.Year > 2010) { e.Day.IsSelectable = false; } }  i have refer to link below but still no idea how to let user select only tuesday and thursday. http://msdn.microsoft.com/en-us/library/k4t1kwcd%28v=VS.80%29.aspx

how to highlight todays date in calender extender control and how to apply css



how to highlight todays date in  calender extender control popus and  how to apply background color to every cell in calender control

and how to apply css 

<asp:TextBox ID="txt_DueDate" runat="server"></asp:TextBox>
                        <cc1:CalendarExtender ID="cal" runat="server" TargetControlID="txt_DueDate" PopupButtonID="btn_AddDue_Date">
                        <asp:Button ID="btn_AddDue_Date" runat="server" Text="Add_DueDate" OnClick="Add_New_Schedule" />

Calender control


I am using calendar control from "clr-namespace:Microsoft.Windows.Controls.Primitives;assembly=WPFToolkit"

I want to add a new feature and make as a custom control.

I want to add a column on left side which shows the WeekColumn.

Expample if you start the month from jan it is come like





I need your help to solve the issue. Please help me.

DataAnnotation on multiple user controls displaying on wrong control


I have a table that displays a user control on each row. The user controls are strongly typed to a viewmodel which contains DataAnnotation style validation. If one of the rows has invalid data entered (lets say the 3rd row) the data annotation validates display agains the first row/user control.

How do I get the data annotation to show against the relevant user control?

I'd post a pic to show what I mean except it will not display it!.:/

Calendar control - disable dates? (calendar extender)


Hi there,

Does anyone know if it is possible to disable some of the dates available for selection.  For example, on opening the calendar all the dates before today are grayed out so that it is only possible to select dates in the future.

On my site I am using two calendar controls which are representing a start date of an event and an end date.  In the end date calendar I would like to disable all dates before the selected start date.

Is anything like this possible with the calendar control?

Thanks for your help,

Report viewer control is is displaying parameter item 'select a value' even when the default param



I am using SSRS 2008 R2,

I have set the default parameter of dropdown and in the output "select a value" item text is removed ,also in the Report Manager 'select a value' removed .

But when I am displaying the same reports in the ReportViewer control as ReportViewer1.ServerReport  in the the vs 2010 asp.net project the item select a value is reappearing in the output.

Could you please help me remove the default item text 'select a value' from the ReportViewer control aswel.


Displaying Role-Specific Markup With the LoginView Control



I want to know how can I display role-specific markup using loginview?

I have these three roles, Admin, Editor, Moderator

Each and every user will belog to only one of the following role groups

1. Admin, Editor,  Moderator (Some user/s will have all these three roles)

2. Admin, Editor   (Some user/s will have all these two roles)

3. Admin, Moderator (Some user/s will have all these two roles)

4. Editor, Moderator (Some user/s will have all these two roles)

5. Admin (Some user/s will have all only this role)

6. Editor (Some user/s will have all only this role)

7. Moderator (Some user/s will have all only this role)

Now I want to display some links that will be specific for each role group to which one or more users will belong. So the links I want to display for these role groups are following

1. Admin, Editor,  Moderator    => Only Links of all the pages of Admin, Editor and Moderator

2. Admin, Editor                       => Only Links of all the pages of Admin and Editor

3. Admin, Moderator                => Only Links of all the pages of Admin and Mode

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend