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

disabling pager when in slider mode

3 Answers 31 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Luci
Top achievements
Rank 1
Luci asked on 02 Sep 2008, 02:29 PM
Hello,
How can I disable the grid's slider (PagerStyle.Mode = Slider) ?

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Sep 2008, 04:02 AM
Hi,

Try the followinng code snippet to disable the slider in Grid Pager.

CS:
 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridPagerItem) 
        { 
            GridPagerItem pager = (GridPagerItem)e.Item; 
            RadSlider radsldr = (RadSlider)pager.FindControl("GridSliderPager"); 
            radsldr.Enabled = false
        } 
   } 


Regards
Shinu
0
Luci
Top achievements
Rank 1
answered on 03 Sep 2008, 08:02 AM
oh, I forgot to mention I needed this client-side... I just need to disable a grid and it would be hilarious after all that strive to have all things client-side to make a postback just to disable the slider...

is this possible ? my current setup is to hide it, but it's just plain ugly.
thanks again.
0
Daniel
Telerik team
answered on 04 Sep 2008, 07:48 AM
Hello Luci,

Take a look at the following code:
function GridCreated(sender, args) { 
    var footerCell = sender.MasterTableView.get_element().tFoot.rows[0].cells[0]; 
    for (var childNode = 0; childNode < footerCell.childNodes.length; childNode++) { 
        currentItem = footerCell.childNodes[childNode]; 
        if (currentItem.id && currentItem.id.indexOf("Slider") >= 0) { 
            currentItem.disabled = true//disable text labels 
            if ((sliderObject = $find(currentItem.id))) { 
                sliderObject.set_enabled(false); //disable radSlider 
                sliderObject.repaint(); 
            } 
        } 
    } 
}  

Kind regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Luci
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Luci
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or