We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GenericDropDown with Calendar control(ASP.NET control)

Hi,

Do you have any examples for Example for GenericDropDown with ASP.NET Calendar control (not Syncfusion Calendar control)?

I can't use the Syncfusion Calendar control since it doesn't allow highlight multiple days of a month currently.

Any help would be great!!

Thanks!


18 Replies

VA Valli Syncfusion Team March 5, 2007 06:36 AM UTC

Hi Rekha,

It is possible to embed an ASP.NET Calendar control with a GenericDropDown control. I have created a sample for the same and you can download it from the following link:

http://websamples.syncfusion.com/samples/Tools.Web/4.4.0.51/F57381/main.htm

Please try running the sample and let me know if this helps you.

Regards,
Valli


AD Administrator Syncfusion Team March 5, 2007 05:50 PM UTC

Hi Valli,

The problem I am having is when you click on previous month or next month on the calendar, the pop up for Generic Dropdown window closes. Rather than closing the popup window, the dropdown pop up should stay open until the user makes a selection.

Thanks!!



VA Valli Syncfusion Team March 6, 2007 06:58 AM UTC

Hi Rekha,

The Generic DropDown Window can be kept unclosed, by setting the 'InitiallyPopupShown' property to true in the VisibleMonthChanged event of the Calendar control. I have created a sample for the same and you can download it from the following link:

http://websamples.syncfusion.com/samples/Tools.Web/4.4.0.51/F1_57381/main.htm

Please let us know if you have any other concerns.

Thanks for your continued interest in Syncfusion products.

Regards,
Valli


AD Administrator Syncfusion Team March 6, 2007 11:24 PM UTC

Hi Valli,

Thank you so much for your very good and quick support.

Is it possible no postbacks when month is changed or date is selected?

Any examples..

Thanks!


VA Valli Syncfusion Team March 7, 2007 04:24 AM UTC

Hi Rekha,

Selecting a date or month in the asp.net calendar will trigger a post back. I am afraid that it is not possible to avoid the post back in the above case.

Please let us know if you have any other concerns.

Regards,
Valli


VA Valli Syncfusion Team March 7, 2007 05:33 AM UTC

Hi Rekha,

I regret for the incorrect update in my previous post.

It is possible to place any asp.net control inside a CallbackPanel and it can be controlled via callback. Hence post back can be avoided and callback can be performed for the .net controls to improve the response time of the web page.

I have created a sample for the same and you can download it from the following link:

http://websamples.syncfusion.com/samples/Tools.Web/4.4.0.51/F2_57381/main.htm

Please let us know if you have any other concerns.

Regards,
Valli



AD Administrator Syncfusion Team March 7, 2007 03:16 PM UTC

Hi Valli,

I added the Generic Dropdown with ASP.NET calendar inside the CallbackPanel. This works!

Thank you so much!

Rekha


AD Administrator Syncfusion Team March 8, 2007 03:02 AM UTC

Hi Valli,

Is it possible to provide me with an example where the above example (Calendar with CallbackPanel) has another dropdownlist on the same page. When the user selects a value from the dropdownlist, one of the calendar dates is preselected and also allows the user to navigate the calendar months without posting back.

I tried myself but I am getting an error:

{"Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation=\"true\" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation."}

Please see attached code.

Thanks for your help!

Test78.zip


VA Valli Syncfusion Team March 8, 2007 08:38 AM UTC

Hi Rekha,

I am afraid I couldn't run the sample attached by you. I am getting the issue 'DataAccessCL' could not be found.

When changing the 'Selected Date' of the Dropdown Calendar control using the 'select' element, I am able to reproduce the issue specified by you by using my previous sample attached on 03/07/2007.

To overcome this issue you have to set EnableEventValidation to "false" at <%@Page directive.

Meanwhile I have created a sample which changes the 'Date value' of the calendar control based on the value selected in the 'Select' element without triggering a post back. Similarly the selected date and the year of the Calendar control can be changed without a post back event. You can download the sample from the below link:

http://websamples.syncfusion.com/samples/Tools.Web/4.4.0.51/F3_57381/main.htm

Please let us know if you have any further queries.

Regards,
Valli


AD Administrator Syncfusion Team March 8, 2007 03:33 PM UTC

Hi Valli,

Thanks a bunch!!

Rekha


AD Administrator Syncfusion Team March 20, 2007 05:32 PM UTC

Hi Valli,

When the user selects a date on the calendar, I would like to raise the refresh event for another CallbackPanel which contains a dropdownlist. Based on the calendar selection date, the value of the Dropdownlist is color coded.

The issue I have is: when I select the date, the Calendar1_SelectionChanged event is raised. I set the GenericDropDown text with the selected date like this.

protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
this.GenericCalendar.Text = Calendar1.SelectedDate.ToString("MM/dd/yy");
}

At this point, I would like to raise the CallBackRefresh event for the callbackPanel so that the dropdownlist values gets color coded.

Any help or sample would be great!!

Thanks!


AD Administrator Syncfusion Team March 20, 2007 07:11 PM UTC

Hi Valli,

To add to my previous post...

Since I am not posting back when the user clicks on the next and previous months button by doing the following

function __doPostBack(eventTarget, eventArgument) {

if(eventTarget == "Calendar1")
__sfCallbackPanel1.callback(eventArgument);
else
frwDoPostBack(eventTarget, eventArgument);
}

and so on, there is no autopost back. Since there is no autopostback, the dropdown list box doesn't get updated with color. So the question is if I add another CallbackPanel to the page and add the listbox to the CallbackPanel. How do I raise the Callback_refresh event when a user selects a date?

Thanks!


GB Gokul B Syncfusion Team March 23, 2007 02:42 AM UTC

Hi Rekha,

Sorry for the delay in getting back to you.

You have to raise the callbackpanel refresh event for the second callback panel once the first callback refresh event has been completed. You can achieve this by using "AfterCallbackResponseProcessedScript" property of the callback panel. This will helps you to refresh Listbox, which is placed inside the second Callback panel. Please take a look at the below code snippet.

$ssw:CallbackPanel ID="CallbackPanel1" runat="server" OnCallbackRefresh="CallbackPanel1_CallbackRefresh" AfterCallbackResponseProcessedScript="InvokeCallback()">
$asp:Calendar ID="Calendar1" runat="server" BackColor="#FFFFCC" BorderColor="#FFCC66" BorderWidth="1px" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="#663399" Height="200px" ShowGridLines="True" Width="220px">
.
.
.
$ssw:CallbackPanel ID="CallbackPanel2" runat="server">
// Listbox is placed here
$/ssw:CallbackPanel>
function InvokeCallback()
{
//Invokes the Callback Refresh event for the Second CallbackPanel
__sfCallbackPanel2.callback();
}

Let us know if it helps.

Regards,
Gokulkumar.B


AD Administrator Syncfusion Team March 23, 2007 03:07 PM UTC

Hi Gokulkumar,

Thanks for your reply.

I see an issue when both the GenericDropdown is in a callbackPanel1 and the listbox is in another callbackpanel2. When The CallbackPanel_refresh event is raised the CallBackPanel2 is also raised for all the events on the calendar. Please see the attached code. I try to mimic what I have to do in my app.

In my application, the calendar is updated based on the first listbox. and then when user clicks on previous next or previous months or selects a date, there is no postback but the callbackPanel1_refresh event is called. If I implement the AfterCallbackResponseProcessedScript event as you suggested, the CallbackPanel2_refresh event is also called for every event in the calendar. What can I do to stop the CallbackPanel2_refresh event called except when the date is selected in the calendar by the user?

Thanks!!

Test80.zip


RM Rekha Mallavarapu March 28, 2007 07:29 PM UTC

Any Updates would be great!!

Thanks!


GB Gokul B Syncfusion Team March 30, 2007 01:34 AM UTC

Hi Rekha,

My sincere apologize for this time delay.

I really appreciate your patience on this issue.

As we are working with our 5.1 Beta release of Essential Studio which is expect to release within a day or two. So we couldn't update you at the earliest.However, I will work with this issue with high priority and let you know the details within tomorrow.

Regards,
Gokulkumar.B


VA Valli Syncfusion Team March 30, 2007 11:41 AM UTC

Hi Rekha,

Sorry for the delay in getting back to you.

Herewith I have attached a sample which helps you color code the dropdown list box only when the user selects the date from the
calendar control.

http://websamples.syncfusion.com/samples/Tools.Web/4.4.0.51/F4_57381/main.htm

1. I have used 2 Callbackpanel. The GenericDropDown Control with the calendar placed in one panel, while the dropdownlist control
placed in the other callbackpanel.
2. Since we are using multiple callbackpanel we have to use 'CallbackMultiplexer control'.
3. When the month value is selected in the calendar control, the callback argument will be prefixed by the letter 'V'. When the
the dropdown control is used to select the date a bool variable has been set. Checking these 2 conditions we can color code the dropdownlist
only when the user selects the date from the Calendar control.

Please let us know if you have any other concerns.

Regards,
Valli


RM Rekha Mallavarapu March 30, 2007 05:25 PM UTC

Valli,

It works!!
Thank you for your help!!

Rekha

Loader.
Live Chat Icon For mobile
Up arrow icon