Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
300
Unable to access WebSlider in WebDataGrid pager template
posted

Hello,

I have tried to replicate the following demo: https://www.infragistics.com/samples/aspnet/slider/overview.

It works really well if I hard code the min and max values for the slider as done in the demo. I can page through the data just fine.

In the demo, the presenter, Vic, states that the WebSlider.MaxValue can be assigned programatically depending on the number of rows retrieved from the database.

I have been unable to get this to work. Can anybody that has done this please post a code snippet. I've emailed the presenter Vic as well. However, I am in a rush to get this implemented and am hoping that somebody here might have an answer.

The fundamental issue I have is that when I drop a WebSlider within the PagerTemplate section of a WebDataGrid, the WebSlider does not get added to the design.cs file and so, the WebSlider control is not accessible in the code behind. However, if I add the WebSlider outside the WebDataGrid, it gets added to the design.cs file and can be accessed in the code-behind.

Even if I add the WebSlider outside the WebDataGrid and then drag the WebSlider into the PagerTemplate section of the WebDataGrid, the WebSlider declaration disappears from the design.cs file. Adding it manually does not help either.

I need to be able to update this WebSlider.MaxValue both after the initial retrieve and after filtering rows - I am filtering the DataView manually and not using the WebDataGrid's filtering behavior.

I am able to get the correct value for PageCount using Grid.Behaviors.Paging.PageCount. I just need to be able to find a way to set the WebSlider.MaxValue. and initialize WebSlider.PageIndex.

I am OK with being able to set this WebSlider.MaxValue property on either the client side or server side. Any suggestions?

  • 300
    Suggested Answer
    posted

    Answering my own question...

    WebSlider slider = (WebSlider)Grid1.Behaviors.Paging.PagerTemplateContainer.FindControl("WebSlider1");

    slider.MaxValue = GridEmp.Behaviors.Paging.PageCount;

    Adding the above to the PageLoad event works just fine.