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

[Solved] Emptry string validation

2 Answers 122 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Mark Francisco
Top achievements
Rank 1
Mark Francisco asked on 05 Mar 2010, 11:25 AM
Hi,
In RecurrenceHourly Frequency is selected, how can i validate if there is no input in the interval?

if not,

In what EVENT will i put or add an exception, so that i could catch the error of the empty interval?
i have tried adding the event RecurrenceExceptionCreated, but when i try to debug, it doesn't go there.

and 1 more, what are the events that will be trigger if i click the save button?

TIA

 

2 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 11 Mar 2010, 12:51 PM
Hi Mark,

Adding validators to these numeric inputs will not be easy without modifying the whole template. We plan to make improvements to the advanced template and this will be one of the issues that we'll address.

You can use the AppointmentCommand event to assign a default value to them in case the user has not provided one:

protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
{
    if (e.CommandName == "Update" || e.CommandName == "Insert")
    {
        CheckBox recAppointment = e.Container.FindControl("RecurrentAppointment") as CheckBox;
        if (recAppointment != null && recAppointment.Checked)
        {
            RadioButton hourly = e.Container.FindControl("RepeatFrequencyHourly") as RadioButton;
            if (hourly != null && hourly.Checked)
            {
                RadNumericTextBox interval = e.Container.FindControl("HourlyRepeatInterval") as RadNumericTextBox;
                if (interval != null && !interval.Value.HasValue)
                {
                    interval.Value = 1;
                }
            }
        }
    }
}

Thank you for spotting this problem. As a token of gratitude for your involvement your Telerik points have been updated.

hope this helps.

Best wishes,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Mark Francisco
Top achievements
Rank 1
answered on 12 Mar 2010, 06:29 AM
thank you Sir Mark. the code really helps. I love you guys :)
keep up the good work
Tags
Scheduler
Asked by
Mark Francisco
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Mark Francisco
Top achievements
Rank 1
Share this question
or