Slider disappears

10 posts, 0 answers
  1. Dan
    Dan avatar
    739 posts
    Member since:
    Mar 2009

    Posted 11 May 2007 Link to this post

    I have a grid that I want to use a slider in (as a custom pager).

    The thing is, the pager used by the end-user is selectable at run time. Not a problem, I've got a couple of pagers that my users can use.

    FYI I'm talking about a project that can be found here.

    Using a technique one of the Grid support guys gave me, I intercept the Grid's standard Pager initialization and plug in my own, like this ...
        void Grid_ItemEvent(object sender, GridItemEventArgs e) { 
          if(e.EventInfo is GridInitializePagerItem) { 
            e.Canceled = true
            GridInitializePagerItem info = e.EventInfo as GridInitializePagerItem; 
            (e.Item as GridPagerItem).PagerContentCell.Controls.Clear(); 
            (e.Item as GridPagerItem).PagerContentCell.Controls.Add(SelectPager(info)); 
          } 
        } 
     
    Where 'SelectPager' is a routine that returns the relevant pager object.

    Works a treat.

    However, if my Pager control is a RadSlider things are a little different.

    The slider is created and added to the PagerContentCell.Controls collection, but when the Grid is resized only the outer container for the Slider is there.

    This is the HTML generated when the Grid is first displayed...
        <table> 
          <tr class="GridPager_Default"
            <td colspan="7"
              <div id="RadSliderWrapper_RadGrid1_ctl01_ctl03_ctl01_ctl00" class="radslider RadSlider_Default horizontal" unselectable="on" style="width: 200px;"
                <title="Decrease" class="handle decrease" href="javascript:%20void(0);" id="RadSliderDecrease_RadGrid1_ctl01_ctl03_ctl01_ctl00" onmouseup="this.blur();" name="RadSliderDecrease_RadGrid1_ctl01_ctl03_ctl01_ctl00"><span>Decrease</span></a><span class="track" id="RadSliderTrack_RadGrid1_ctl01_ctl03_ctl01_ctl00" unselectable="on" style="width: 178px; height: 2px;"></span> 
                <div class="selectedregion" id="RadSliderSelected_RadGrid1_ctl01_ctl03_ctl01_ctl00" style="width: 4.5px;"
                  <span class="track" id="RadSliderTrack_RadGrid1_ctl01_ctl03_ctl01_ctl00" unselectable="on" style="width: 178px; height: 2px;"><!-- --></span
                </div><span class="track" id="RadSliderTrack_RadGrid1_ctl01_ctl03_ctl01_ctl00" unselectable="on" style="width: 178px; height: 2px;"><title="Drag" class="draghandle" href="javascript:%20void(0);" id="RadSliderDrag_RadGrid1_ctl01_ctl03_ctl01_ctl00" onmouseup="this.blur();" style="left: 0px;" name="RadSliderDrag_RadGrid1_ctl01_ctl03_ctl01_ctl00"><span>Drag</span></a></span><a title="Increase" class="handle increase" href="javascript:%20void(0);" id="RadSliderIncrease_RadGrid1_ctl01_ctl03_ctl01_ctl00" onmouseup="this.blur();" name="RadSliderIncrease_RadGrid1_ctl01_ctl03_ctl01_ctl00"><span>Increase</span></a
              </div> 
              <div style="width: 200px; display: none;" class="radslider RadSlider_Default horizontal" id="RadGrid1_ctl01_ctl03_ctl01_ctl00"
                <input type="hidden" name="RadGrid1_ctl01_ctl03_ctl01_ctl00_ClientState" id="RadGrid1_ctl01_ctl03_ctl01_ctl00_ClientState" value="{"
              </div> 
            </td> 
          </tr> 
        </table> 
     

    And this is what it looks like after the Grid is resized....
        <table> 
          <tr class="GridPager_Default"
            <td colspan="7"
              <div style="width: 200px;" class="radslider RadSlider_Default horizontal" id="RadGrid1_ctl01_ctl03_ctl01_ctl00"
                <input type="hidden" name="RadGrid1_ctl01_ctl03_ctl01_ctl00_ClientState" id="RadGrid1_ctl01_ctl03_ctl01_ctl00_ClientState"
              </div> 
            </td> 
          </tr> 
        </table> 
     

    All I'm doing ATM to create my Slider is this ...
    public class PageSlider : RadSlider { 
      public PageSlider() 
        : base() { 
        MinimumValue = 1; 
        MaximumValue = 100; 
        Length = 200; 
     
        AutoPostBack = true
      } 
     


    --
    Stuart
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 11 May 2007 Link to this post

    Hi Stuart Hemming,

    I'm not sure what could cause this behavior. Are there any JS errors which can help us?

    What is happening when the grid is resized? Are there any postbacks/ajax requests or any logic that could possibly cause the slider to disappear?

    With the html provided I can assume that by some reason the initialization of the Radslider has not been done, or a JS error has appeared and the slider has not been initialized truly.


    All the best,
    Valentin.Stoychev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dan
    Dan avatar
    739 posts
    Member since:
    Mar 2009

    Posted 11 May 2007 Link to this post

    Valentin,

    thanks for responding, I'm going mad here.

    To help answer your questions, I've put a copy of my project here.

    Firebug suggests that at the end of the process of showing the screen (the grid is in a RadSplitter in a RadWindow) there are 4 POSTs. The Grid is resized because the RadPane is resized on loading.

    There are no errors that I can see.

    --
    Stuart
  5. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 11 May 2007 Link to this post

    Hi Stuart,

    The slider is not initialized after the resize, because the ajax request that is made from the grid. There is an issue with the grid control which will be resolved in the next update ( at the end of the month ).

    Best wishes,
    Valentin.Stoychev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Dan
    Dan avatar
    739 posts
    Member since:
    Mar 2009

    Posted 11 May 2007 Link to this post

    Valentin,

    8-(

    Is there a work around I can employ in the meanwhile?

    --
    Stuart
  7. Dan
    Dan avatar
    739 posts
    Member since:
    Mar 2009

    Posted 11 May 2007 Link to this post

    I am having a really crappy week.

    Switching off the Grid's internal Ajax and putting it in an AjaxPanel hasn't helped. 8-(

    --
    Stuart
  8. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 14 May 2007 Link to this post

    Hello Stuart Hemming,

    We are releasing the Service pack very soon - it should be available next week so it is better to wait and use the clean solution instead.

    Other than that, the slider control can be instantiated on the client so you can initialize it manually after the ajax request is done, but once again - you better wait for the fix which is coming.

    Thank you for reporting the issue.

    All the best,
    Valentin.Stoychev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. Dan
    Dan avatar
    739 posts
    Member since:
    Mar 2009

    Posted 14 May 2007 Link to this post

    Valentin,

    I'll go with your suggestion and wait for the service pack.

    Will it be generally available or do I need to raise a support ticket?

    --
    Stuart
  10. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 15 May 2007 Link to this post

    Hello Stuart,

    It will be generally available - no need from support ticket.

    Best wishes,
    Valentin.Stoychev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  11. Dan
    Dan avatar
    739 posts
    Member since:
    Mar 2009

    Posted 15 May 2007 Link to this post

    Valentin,

    That's great. Thanks very much.

    --
    Stuart
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017