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

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

How to bind a calendar control to a datasource

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :ASP.Net
In my application, user will enter some meeting dates in one page.   In the details page, they need to see those dates to make a selection for one file number. I want to show a calendar in the details page whice will show the dates already entered. To do that I need to bind the calendar to a datasource to get the information from the database. Please guide me to do that. Thanks in advance,

View Complete Post

More Related Resource Links

Access and Bind data wihtout using Datasource Control


i want to bind my gridview with a dataset with concept of caching (to minimize the database server trips). plz give me a best example to get and bind data to gridview (command line) . grid paging is also enabled so example code should be capable to rebind data at Gridview page change.  

Best method to get data from a datasource to a calendar control


Hello all. I am kind of running in circles here. I am building a meeting calendar and want to use a calendar control to display meetings. What I would like to do is cache the datasource, and use the calendar visibledate property and dayrender event to add the records to the correct days, but I can't seem to find any way to get from one to the other. Can anyone point me in the right direction here?

How To Add calendar control inside a GridView

This article show hot to add calendar control inside a GridView with code in c#

Using ATLAS PopUp Control with Calendar inside the GridView Control

In this video tutorial Mohammad demonstrates how you can access the Calendar control which is displayed using the ATLAS PopUp control inside the GridView control.

Manually sorting and paging Gridview without using datasource control

Many a times while working with Gridview we want to work with the paging and sorting functionality without using any datasource control. Gridview is flexible enough to perform these tasks without the use of any datasource control and only a few lines of code.

Reuse a gridview within calendar control


Hello, I have a calendar control that will have events displayed within each cell.

I want to use a pre formatted gridview and simply bind the gridview with a dataset dynamically and display it within the cell of the specified day.

Is there a way to do that or do I have to dynamically build a gridview for every day that there is an event? 

So here is the template gridview and datasource:

 <asp:SqlDataSource ID="sqlcalitemtemp" runat="server" 
        ConnectionString="<%$ ConnectionStrings:NNTrainingdbconnection %>" 
        SelectCommand="SELECT NN_Fire_Events.Start_Time, NN_Fire_Events.End_Time, tblNN_Fire_Cli

Stored Procedures & SqlDataAdapter not updating a calendar control


Hi all,

I have a database linked to a calendar. I had a peice of code that retrieved dates from a database and populated the calendar. I wanted to tidy up my code using stored procedures (they seem neater & i assume there's a benefit somewhere). so i came up with this, however it's not working. The calendar displays, but it's not being populated with the database entries. The SqlCommand & SqlParameter I have working elsewhere in my code; as with the SqlDataAdapter (which also worked before i tried to conver to a stored procedure!) but combining these three (SqlCommand, SqlParameter & SqlDataAdapter) seem to be causing me problems.

It's probably something stupid but if someone could take a look and point me in the right direction, I'd be very grateful.


Public Sub dbConnection()
        dbConnString = ConfigurationManager.ConnectionStrings("connString").ConnectionString
        sqlConn = New SqlConnection(dbConnString)
    End Sub

Public Sub EquipmentDDLSelection()

        Dim dbCMD As New SqlCommand("PopulateCalendar", sqlConn)
        dbCMD.CommandType = CommandType.StoredProcedure

        Dim parameterBookedEvents As New SqlParameter("@bookedEvents", SqlDbType.VarChar, 50)

calendar control, show onHover


hi all,
is it possible to have a calendar control on an asp.net page that is diplayed only onHover over some area?
Most of the times, the control won't be needed and I would like to save the space for something else. In case the calendar is needed I want it to slide down from under a link or button (most likely it will be an image there).

thanks a bunch,

Calendar control and date


I have a calendar control , text box and a button . The calendar is invisible in the page load event. When I click on the button,It becomes visible. On selection of a date it becomes the value of the Text Box.
Having said that, my issue is that when this calendar becomes visible, it ruins the arrrangement of the controls on the  page. As I have other controls on the page they  comepletely get displaced. Is there a way to overlap this calendar over the other controls.
I had seen a control that was  some time ago and it was on the client side(probably using javascript or a third party control ) and It wud overlap the other controls and once a value was selected it became invisible.

Applying custom CSS to the MOSS 2007 Calendar control Month view



I have a requirement to use the MOSS 2007 Calendar Control - month view is to apply a custom css to have a look and feel as per our requirements.

We tried applying the custom css to the MOSS 2007 calendar control - month view, it does take the custom css and applies it, but when i click on any date and come back to the calendar control, it changes the CSS of the MOSS calendar control back to the default one.

Let me know if anyone has any suggestion on  how to customize the calendar control for css for our intranet application.

Your response would be highly appreciated.






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

How to Bind a child control with properties of the parent control in Silverlight and WPF?

Dear Experts, I have a usercontrol in Silverlight and I want to enable the update button inside the usercontrol with property defined in the usercontrol. For the proof of concept sake I have defined the usercontrol xaml and the code behind in VB.NETBelow is the XAML and VB.NET Code. ----------------------------------------------------------------------- <UserControl x:Class="SLBAppAssementQuestions.SilverlightControl1"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"     mc:Ignorable="d"     d:DesignHeight="300" d:DesignWidth="400">     <StackPanel>         <CheckBox x:Name="chkBox1" Margin="10" Checked="chkBox1_Checked" >Checkbox1</CheckBox>         <CheckBox x:Name="chkBox2" Margin="10" Checked="chkBox2_Checked">Checkbox1</CheckBox>         <Button  x:Name="BtnUpdate&q

Show Calendar Control SQL data value using Label control

Hi, I have a Calendar Control which is getting certain dates from SQL database and shows them in gray colour using following SQL statements: protected void Calendar1_DayRender(object sender, DayRenderEventArgs e) { DateTime nextDate; if (dShows != null) { foreach (DataRow dr in dShows.Tables[0].Rows) { nextDate = (DateTime)dr["Date"]; if (nextDate == e.Day.Date) { e.Cell.BackColor = System.Drawing.Color.DarkGray; } } }  SELECT Count(Mytable.ID), Mytable.Date,MAX(Location.SLocation) as Location FROM Mytable INNER JOIN Location ON Mytable.Sh_ID=Location.Sh_ID GROUP BY Mytable.Date Everything works fine but I want to Show Location and Date also under the calendar control usnig Label control so when user clicks highlighted date it shows Date and Location (only the ones which are coming from SQL database and are highlighted) using Label control. Thank you.      

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

I need a suggestion to bind the data in share point 2010 page.Suggest some right control to do this.

In my visual web part i need a control to display rows with grouping option. In my web part i am going to display all my document library and  announcement so that i need groping option. I need to do grouping option in the view.so what is the best control u suggest me to bind my data? 

FormView control having radiobuttonList as child control which is bound to another datasource

Hi all, Mine is an Online Exam application. I am thinking to place the questions and answer options inside a formview control. As options are from different table ,so I wanted to use RadioButtonList as child control of FormViewControl to display options which is bound to another datasource .How can I do this please help.  

Is it best to use Eval or Bind in a databound control?

I have a repeater I've databound with a generic arraylist from a LINQ query (.ToList() )  in the code behind.  I was using   <%# Bind("FirstName")%> but noticed  <%# Eval("FirstName")%> works just as well.    Is it better to use Eval or Bind?  or does it depend on the situation?        
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