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

Problem with Validating Resources

5 Answers 60 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 01 Sep 2011, 01:10 PM
Hi,

 How can i validate resource of Type Dropdown so that it should not apply the 0 index value for insertion. i have a resource Task whose values are shown in dropdown box for insertion or updation. it shows value at top with '-' or blank value. i need to validate that value so that it should be selected or there is any other way like blank value never shows up at the top. i am sending screen shot or resource  for better understanding,



Thanks 

5 Answers, 1 is accepted

Sort by
0
Dan Lehmann
Top achievements
Rank 1
answered on 01 Sep 2011, 02:38 PM
If you are handling AppointmentInsert in the codebehind, set e.Cancel = True to abort the insert if validation fails.

Dan
0
Kevin
Top achievements
Rank 1
answered on 02 Sep 2011, 05:57 AM
Thanks for the Reply Dan...... But can't we validate it on the client side or we can just remove the zero index item and directly Display the first key item in dropdown. it will be good if we can validate on client side or there some other option.
pls reply if any one can help with this....


Thanks
0
Ivana
Telerik team
answered on 03 Sep 2011, 09:08 AM
Hello Kevin,

Yes, you can make selected item check on the client-side.

I made an example for you showing how to modify the ComboBox controls inside the AdvancedForm of the Scheduler using JavaScript.

Attached is a .zip file containing only the .aspx file of the example.

Hope this helps.

Best wishes,
Ivana
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Kevin
Top achievements
Rank 1
answered on 06 Sep 2011, 11:19 AM
Thanks fr the reply Ivana , i still not able to remove by default selected '-' symbol or any other text that i can put there.
i just want able to set selected index of dropdown to one. so that no validation will required. when advance form will open, it already have selected index one i.e task one will be selected. please reply if you can help.

Thanks
0
Peter
Telerik team
answered on 07 Sep 2011, 02:09 PM
Hello Kevin,

You can access the resource combobox in FormCreated and set its SelectedIndex property from code behind. Here is a kb article that will help with this task - http://www.telerik.com/support/kb/aspnet-ajax/scheduler/how-to-access-controls-in-the-advanced-form.aspx.


Kind regards, Peter
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Scheduler
Asked by
Kevin
Top achievements
Rank 1
Answers by
Dan Lehmann
Top achievements
Rank 1
Kevin
Top achievements
Rank 1
Ivana
Telerik team
Peter
Telerik team
Share this question
or