AdvancedEditForm question

10 posts, 0 answers
  1. Lukrs
    Lukrs avatar
    39 posts
    Member since:
    Sep 2012

    Posted 23 Sep 2008 Link to this post

    Hi,

    I have a simple question. If I add a child element <AdvancedEditTemplate> to my radScheduler I have to specify all of the components; I can't just add one asp:label for example. All the other elements vanish.

    I need just to validate the advanced edit form, by the way, is there any other method to do this? MsgBox which is called inside the RadScheduler1_AppointmentUpdate event also doesn't work.

    Maybe I overlooked the solution on other threads, because it seems a very common problem.

    Anyway,
    thanks in advance for your reply.

    LP, Luka
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 24 Sep 2008 Link to this post

    Hello Luka,

    You may consider using the Customizing the Advanced Template example. This way you can customize the advanced template without implmenting the default functionlity such as recurrence and resources from scratch.

    Feel free to contact us if you have further questions.

    Best wishes,
    Peter
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Lukrs
    Lukrs avatar
    39 posts
    Member since:
    Sep 2012

    Posted 06 Oct 2008 Link to this post

    Hi,

    At first, sorry for the late reply. Advanced template functionality sounds great, but I still can't figure it out.

    All I actually want is to popup an alert to the user, if the form isn't filled out correctly. It can be an ajax alert, msgbox, label that fills with text on submit, ... whatever.

    Isn't there supposed to be an easy way to do this? I tried adding a label to advanced edit form but I just dont' know how to referece the input textarea for example (if the textarea is empty...etc.).

     I would really appreciate your help.

    Thank you in advance,
    LP, Luka


  5. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 07 Oct 2008 Link to this post

    Hi Luka,

    If you just need to validate for empty Subject, you can use the following approach and cancel the AppointmentInsert and AppointmentUpdate events if the appoitment subject is empty:

    protected void RadScheduler1_AppointmentInsert(object sender, Telerik.Web.UI.SchedulerCancelEventArgs e)  
        {  
            if (e.Appointment.Subject == String.Empty)  
            {  
                Label1.Text = "Subject cannot be empty. Please, enter some text.";  
                e.Cancel = true;  
            }  
            else 
                Label1.Text = String.Empty;  
        }  
        protected void RadScheduler1_AppointmentUpdate(object sender, Telerik.Web.UI.AppointmentUpdateEventArgs e)  
        {  
            if (e.ModifiedAppointment.Subject == String.Empty)  
            {  
                Label1.Text = "Subject cannot be empty. Please, enter some text.";  
                e.Cancel = true;  
            }  
            else 
                Label1.Text = String.Empty;  
        } 


    Regards,
    Peter
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Lukrs
    Lukrs avatar
    39 posts
    Member since:
    Sep 2012

    Posted 12 Oct 2008 Link to this post

    Hello,

    I have used the advanced edit/insert template, and I added the events from the previous post.

    I have only just one question...how to access the label defined in SchedulerDefaultForm.ascx from my Default.aspx, where I use radScheduler control?
  7. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 13 Oct 2008 Link to this post

    Hello Luka,

    The Step by step walk-through in this help topic shows how to do this. If you have added additional labels or any other controls, just use the same approach of exposing properties from SchedulerDefaultForm to AdvancedForm to AdvancedEditForm/AdvancedInsertForm.

    Let us know if you require further help with this.



    Regards,
    Peter
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. Lukrs
    Lukrs avatar
    39 posts
    Member since:
    Sep 2012

    Posted 19 Oct 2008 Link to this post

    Hello,

    I need to access the label from default.aspx.cs. The mentioned tutorial does not do what I need.

    I see the label in advanced insert/edit form in web browser, but i need to access it from default.aspx.cs to change the text. Is that so hard to accomplish with radscheduler?

    In case it is I guess i'll just wait for the q3 release, where validation problem is solved I think.

    Regards,
    Luka
  9. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 20 Oct 2008 Link to this post


    Yes, I recommend you try the built-in validation that we provide with Q3 2008 Beta release. If you need further customization than what is already provided, let us know and we will take the case from there.


    Greetings,
    Peter
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. Lukrs
    Lukrs avatar
    39 posts
    Member since:
    Sep 2012

    Posted 06 Feb 2009 Link to this post

    Hi again,

    Well I got the new Q3 release, and the validation is taken care of now.

    But I have a new problem: I followed the tutorial on this site:

    http://www.telerik.com/help/aspnet-ajax/schedule_advancedformtemplate.html

    I did everything it says, but when I try to access the advancededit or insert form in my application I get the following error :

    Napaka: [Exception... "'Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.' when calling method: [nsIDOMEventListener::handleEvent]"  nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "<unknown>"  data: no]

    This is a copy-paste error from Firefox "Error Console". (A part of webDeveloper addon).

    And the following error is thrown by IE8:

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30428; .NET CLR 3.0.30422)
    Timestamp: Sat, 7 Feb 2009 11:13:08 UTC


    Message: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
    Line: 4674
    Char: 21
    Code: 0
    URI: http://localhost:64667/planeKoledar/ScriptResource.axd?d=CtVywZQzmVx7CdbOTRFzUTpjGv_IeTfmXKYJaz9kJyzV6cFi75yE98fD3vgMAR0nSzxTJvjbX5-PoOvPK_LyhiT0fS4UAP2nESr6bHVk3Vg1&t=ffffffffc165464a


    Now I tried not to edit the advanced forms, I used the ones just like they are in C:\Program Files (x86)\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\Scheduler\Examples\AdvancedFormTemplate\DefaultTemplates\CS and I still get the mentioned error.



    Any help would be appreciated.

    thanks in advance,
    Lp, Luka
  11. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 09 Feb 2009 Link to this post

    Hi Luka,

    Without test project it would be hard for us to tell what is causing this problem. I suggest you download and use as reference the sample(WebApplicationForQ32008.zip) from this kb:
    http://www.telerik.com/support/kb/aspnet-ajax/scheduler/sample-project-of-the-customizing-the-advanced-template-example.aspx 

    If you continue to experience problem, please open a support ticket and send us a working demo which we can test locally.



    Peter
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017