RadSlider - problem when switching between IsSelectionRangeEnabled true and false

8 posts, 0 answers
  1. Stephen
    Stephen avatar
    13 posts
    Member since:
    Aug 2008

    Posted 01 Dec 2008 Link to this post

    Hi,

    I have experienced a couple of issues with the RadSlider when switching between 

    IsSelectionRangeEnabled=true and false.

    The sequence is as follows...
    If I start with IsSelectionRangeEnabled=false and then in code behind set it to true two things happen

    1. The SelectionStart property gets set to the Value property regardless of what it is set to in the code and
    2. The ValueChanged event for the left SelectionStart handle is dissabled. The right handle (SelectionEnd) still works fine.

     

     


    Any advice would be appreciated.

     

    Thanks
    Steve

  2. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 02 Dec 2008 Link to this post

    Hi Stephen,
    I was able to reproduce both problems and forwarded them to our developers. We will fix both of them for the next update of the suite, namely Q3 2008 SP2. Unfortunately, for the time being, I can offer you a workaround only for the first problem - just to set the Value property to the same value as the SelectionStart property.

    RadSlider1.SelectionStart = 20;  
    RadSlider1.Value= 20; 

    I have updated your Telerik points for bringing these issues to our attention.

    All the best,
    Tsvetie
    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. Stephen
    Stephen avatar
    13 posts
    Member since:
    Aug 2008

    Posted 02 Dec 2008 Link to this post

    Hi Tsvetie,

    Thanks for the response. Found the first solution already.

    I have a partial solution for the second problem and was hoping you could help me fill in the rest. 

    I disabled the AutoPostBack from the Slider. Instead I did an ajaxRequest from the OnClientSlideEnd event. This takes care of the lost event from the left handle. I get the correct changed values back from the Slider. However the left handle snaps back to the original position. For example

    1) Slider is swicthed between the modes to create the problem.
    2) Slider left handle starts at position 100
    3) Slider left handle moved to 200
    4) ajaxRequest called and position correctly returned as 200 (update other controls on page to reflect this)
    5) Left handle snaps back to postion 100

    Is there something in ViewState I need to change manually from the ajaxRequest handler?

    Regards
    Steve
  5. Stephen
    Stephen avatar
    13 posts
    Member since:
    Aug 2008

    Posted 03 Dec 2008 Link to this post

    Hi Tsvetie,

    Following on from my previous email I tried setting up 2 sliders - one in each configuration - then toggling the Visible property for them according to which slider mode I wanted. I found that the display behaved oddly. Rather than hiding one and showing the other it would hide both or show both. Tried with the sliders in separate divs or the same div.

    Any eta on when the SP2 will be out?

    Regards
    Steve

  6. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 03 Dec 2008 Link to this post

    Hi Stephen,
    We do not have an exact date for SP2 - it will be available for download in about a month. Instead of implementing a complex workaround, if it is an option for you, I can send you an internal build with the necessary changes to the RadSlider control. In you decide to use this option, please open a new support ticket and I will send you the hotfix.

    Regarding the Visible property of the RadSlider - I was not able to reproduce this one. I tested with the following code:
    <body> 
        <form id="form1" runat="server">  
            <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
            <telerik:RadSlider ID="RadSlider1" runat="server"></telerik:RadSlider> 
            <telerik:RadSlider ID="RadSlider2" runat="server"></telerik:RadSlider> 
              
            <asp:Button ID="Button1" runat="server" Text="Switch_IsSelectionRangeEnabled" OnClick="Button1_Click" /> 
        </form>      
    </body> 

    code-behind:
    protected void Button1_Click(object sender, EventArgs e)  
    {  
        RadSlider2.Visible = !RadSlider2.Visible;  

    If you could send me the code that demonstrates this problem, I will do my best to find the cause for it.

    Greetings,
    Tsvetie
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Stephen
    Stephen avatar
    13 posts
    Member since:
    Aug 2008

    Posted 03 Dec 2008 Link to this post

    Hi Tsvetie,

    Please see below the code that replicates the issue.

    aspx code

     

    <form id="form2" runat="server">

     

     

    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

     

     

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

     

     

    <AjaxSettings>

     

     

    <telerik:AjaxSetting AjaxControlID="CheckBox2">

     

     

    <UpdatedControls>

     

     

    <telerik:AjaxUpdatedControl ControlID="RadSlider1" />

     

     

    </UpdatedControls>

     

     

    </telerik:AjaxSetting>

     

     

    </AjaxSettings>

     

     

    </telerik:RadAjaxManager>

     

     

    <div>

     

     

    <div>

     

     

    <div style="float:left"><telerik:RadSlider runat="server" ID="RadSlider1" /></div>

     

     

    <div style="float:left"><telerik:RadSlider runat="server" ID="RadSlider2" IsSelectionRangeEnabled="true" /></div>

     

     

    <div style="float:right"><asp:CheckBox ID="CheckBox2" runat="server" Text="Toggle sliders" TextAlign="Left" oncheckedchanged="CheckBox2_CheckedChanged" AutoPostBack="true" /></div>

     

     

    </div>

     

     

    </div>

     

     

    </form>

     


    cs code

     

    protected void Page_Load(object sender, EventArgs e)

     

    {

     

    if (!IsPostBack)

     

    {

    CheckBox2.Checked =

    true;

     

    RadSlider1.Visible =

    false;

     

    RadSlider2.Visible = !RadSlider1.Visible;

    RadSlider1.MaximumValue = 150;

    RadSlider1.Value = 100;

    RadSlider2.MaximumValue = 100;

    RadSlider2.MinimumValue = 0;

    RadSlider2.SelectionStart = 20;

    RadSlider2.SelectionEnd = 35;

    }

    }

     

    protected void CheckBox2_CheckedChanged(object sender, EventArgs e)

     

    {

    RadSlider1.Visible = !CheckBox2.Checked;

    RadSlider2.Visible = CheckBox2.Checked;

    }



    If you remove the line 

    <telerik:AjaxUpdatedControl ControlID="RadSlider1" /> from the ajax manager the problem goes away (ie sliders show and hide correctly. With this line in one slider does not hide.

    Regards
    Steve

     

  8. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 04 Dec 2008 Link to this post

    Hi Stephen,
    Thank you for the provided code - it helped me understand the problem. It is caused by the fact that you expect two RadSliders to get updated during the AJAX request, but you have configured the RadAjaxManager to actually update only the first.

    In order for the two RadSlider controls to get updated, you need to modify your RadAjaxManager definition the following way:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="CheckBox2">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadSlider1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadSlider2" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 

    I have attached my test page for your reference as well.

    Kind regards,
    Tsvetie
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  9. Stephen
    Stephen avatar
    13 posts
    Member since:
    Aug 2008

    Posted 04 Dec 2008 Link to this post

    Hi Tsvetie,

    So simple - I took the code from the original single RadSlider mode switching implementation to make the dual RadSlider-one-of-each solution. I missed the extra ajaxmanager line.

    Thanks for the hotfix.
    Steve
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017