RadDatePicker gets distorted on visibility change after postback

2 posts, 0 answers
  1. Neha
    Neha avatar
    1 posts
    Member since:
    Aug 2012

    Posted 03 Apr 2012 Link to this post

    In my application I am using 2 RadDatePickers for selecting a range of Date. They are present inside a Div container.
    These date pickers are using a shared RadCalendar and RadAjaxManager.
    I have radio buttons that control the visibilty of the DatePickers.
    A button which performs some action and causes a complete postback.

    Everything shows fine when i load the page for the first time. 
     
    Inline image 3

    Then i hide the Div containing the DatePickers on click of one of the radio buttons using:

    DivFromDate.Visibility  = false;
    DivToDate.Visibility = false;

    Then i click on the button which causes a complete postback.

    My problem is when i show the Div again containing the DatePickers, on click of the last radio button using:

    DivFromDate.Visibility  = true;
    DivToDate.Visibility = true;

    the UI of the RadDatePicker gets distorted.

    Inline image 4

    Any help would be appreciated.

    Thanks,
    Neha 
  2. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 06 Apr 2012 Link to this post

    Hello Neha,

    I suppose you want to call a postback on all your controls with a button. However, in this case the updated controls are ajaxified therefore the erratic behavior which arises is expected.
    In order to cause your button to update your ajaxified controls, please do the following:
    • add a panel to contain all controls you wish to update on button-click postback
    • configure your RadAjaxManager settings so:
      • the panel updates itself
      • the button updates the panel
    I have attached a sample project where these steps are done.

    All the best,
    Eyup
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top