Web Forms :: Scroll Position With Multiview Control?
Jan 5, 2011
I have a multiview control on a page with multiple child view controls. As the ActiveViewIndex is changed when I nagivate between views, I'd like to reposition the scroll position of the browser. For instance, when toggling between a very long page with a huge gridview (page 1) and a smaller page that follows (page 2), I'd like my scroll position to start back at the top of the page when I navigate to the smaller page. Currently, if I scroll down on Page 1 and select an item that navigates me forward to page 2, the scroll position is maintained and I start too far down the page when Page 2 displays. I have programatically set MaintainScrollPosition to false on Page_Load so this should not be a factor.
I have found many articles claiming to show you how to set the scroll position of a ListBox, but what they really end up showing you is how to set the SelectedIndex of a ListBox.
Here is what I need: a databound ListBox that's usually going to have around 25 items in it. When the page loads, ALL of the items in the ListBox are selected, and the ListBox is scrolled all the way to the bottom.
I've got the "All items Selected" requirement already, but I can't figure out how to get the "Scroll to the bottom" done.
I have a page that uses AJAX updatepanels. On this page, we have some radio buttons with Autopostback set to true. The problem is that after the postback, the control was losing focus so that when the user would hit tab, control would be restored to the first control on the page and not the drop-down which fired the event. As a fix, I wrote some set focus code in the radio button's oncheckchanged event. This seems to have fixed the problem with the focus. The problem I have is that the browser loses its scroll position every time I click on one of these radiobuttons. Is there a way to maintain scroll position? Maybe there is another way to resolve my original problem of setting focus that will prevent this from happening.
I want to maintain the scroll position of a page. So I try to get the page cordinates and set the position on the page load (actually I've a postback in my page) using JS as follows. What I've done is on a client click on an image get the page cordinates and keep in a hidden field.
GetScollerPosition function invoke in an image click event. But it's not work as I expected, the SetScrollPostion always find the value of hidden fields as zero.
I have implemented the "slimScroll" in a div.¬† Prior to this implementation, I was using the asp.net inherent scrolling and was able to use the Maintain Scroll PositionOnPostback="true" at the Page level and that worked well;¬†but now, this no longer works.¬†
I am building an application using masterpages, one of the pages contains dynamic gridviews with textboxes using templates. The textboxes have the autopostback enables to allow the calculation of the numeric values entered in each row.
The grid has 3 cols (3rd col has the total of the first and sec cols) the problem is that when i change the textbox (therefore a postback is created) the page scrolls up.
I tried the Page.MaintainScrollPositionOnPostBack = True but it does not work. Can i use any other method to solve this poblem.?
The problem is that the textbox is at the bottom of the screen. ¬†I want to set focus on the textbox and also have it move (scroll) to the top of the screen. ¬†This will allow the user to see the entire form, withhout having to scroll initially. ¬†
How can I modify the code to set the textbox (pol_numTextBox) at the top of the page on DataBound once the focus is set?
I have an asp.net listbox with 15 rows and auto postback when the selected item is changed. This works as expected but, when the form is re-loaded, IE scrolls the list so that the last selected item is now the top visible item in the list. This produces a confusing/jumpy effect for the users and makes the listbox more difficult to use than it needs to be.
Is there any way to get the list scroll position to stay as it was before the postback? i.e, if I select an item from the middle of the listbox, the listbox is scrolled to the same point after postback.
I get the following error when i run the code: Microsoft JScript runtime error: 'document.getElementById(...)' is null or not an object Am i missing something? or is there any other better solution to maintain the scroll position
I have a datalist within a table and it scrolls horizontally. The data is set up to progress from past to future. By default the page loads with the table scrolled all the way to the left, and therefore displaying data which is furthest in the past. I would prefer for the table to load with the scroll bar in the middle, so that data at the split between past and future is displayed and the user can go further each way as he desires. how to set the focus within the table to let my datalist load exactly where I want it?
I am using usercontrol to populate a web part. The user control consists of ajax tab and in it there is another user control which is a gridview. I add the tabs - My top level usercontrol to the web part. Now when user makes a selection in the gridview (this does a postback) I would like to maintain the scroll position. I tried adding - this.Page.MaintainScrollPositon = true to the page load event of my tabs (priamary) user control. But it does not seem to work. Is there any other way to maintain position in a web part.
I have serveral long ASP.Net pages, I use RequiredFieldValidator, RegularExpressionValidator and ValidatorCalloutExtender for validations, Submit buttons are typically at the bottom of the pages. The problem I have: if the errors happen at the top portion of the page when Submit buttons are clicked, the forms do not scroll to the top automatically, the users have to scroll up to see the ValidatorCalloutExtender.
I use pagination for my datalist according to this link [URL].....
this is style of pagination
First 1,2,3,4,5 Last
when i run web site i see my datalist with pagination in webpage my datalist is middle of page when i click on page number 2 or 3 to see other page of datalist it reload page and go to top of page i should scroll until I can see my datalist again.
i want when users click on page number after that they see other page of datalist directly not top of page¬†..
I have a gridview with scroll enabled. Means i have a gridview like this-
I want during postbacks scroll position of my gridview will not change. I have tried many articles on the web, but in some scrolling is retained only in IE, in some others scrolling position changes on clicking edit link of gridview. I want a good solution for IE, FF, Chrome