Maintaining The Scroll Position Inside Tag?

Mar 25, 2011

I have a gridview which is placed inside div tag to make the grid view to look like having scrollbars

<div id="divgrd" style="overflow: scroll"; width: 350px; height: 150px>
My grid is placed here.
</div>

Now it displays nice view of the grid with scroll bars. I am changing the color of the row selected from the grid. Only problem is if the grid has around 50 rows and I select the 50th row then the scroll bar moves to the top of the grid. I want to stop it and maintain the scroll position. I cannot change the height of the div tag as the grid may be very large if the rows inside is increased.

View 3 Replies


Similar Messages:

C# - Maintaining Scroll Position After Postback?

Feb 19, 2011

I have some problems with maintaining scroll position after postback. First time I experienced the problem was when I (believe) added Combobox control from AJAX control Toolkit and/or UpdatePanel from AJAX Extensions. The problem is when I do the postback on the page the page is loaded at the top and not where I did the postback. Actually, this wouldn't be a problem if it isn't happening on a very large form. I have already tried using MaintainScrollPositionOnPostback="true", but it wasn't helpful at all. I can provide the code if needed, but I don't think it would be of any use because I have comboboxes inside update panels which are rebinded on a button click.

View 1 Replies

Forms Data Controls :: Maintaining Scroll Bar Position With Javascript?

Jun 22, 2010

I have a scroll bar in GridView. I m maintaining scroll bar position with javascript. It is working fine.

I have one more datagrid in the same page. I want to apply same Javascript to that datagrid also. Here is the javascript I used.

<script language="javascript" type="text/javascript">
var scrollTop;
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function BeginRequestHandler(sender, args)
{
var m = document.getElementById('divexample2');
scrollTop=m.scrollTop;
}
function EndRequestHandler(sender, args)
{
var m = document.getElementById('divexample2');
m.scrollTop = scrollTop;
}
</script>

and here is the reference [URL]

View 12 Replies

Web Forms :: Maintaining Scroll After Postback In Gridview?

May 25, 2010

i have a problem with maintaining a scroll after postback in grid which consists of number of records with vertical scroll bar,when i click on edit link the scroll is moving to top row but not the current updated record i have used MaintainScrollPositionOnPostback="true" and i placed my grid within div tag but it is not working for my grid

View 6 Replies

Maintaining Scrollbar Position And Div Tag State On PostBack?

Feb 26, 2010

I have a web page that regularly refreshes on post back, and all of this works fine. However, a user has made enhance the page, which I need with:

1) There are 3 asp.panels on the page, which are scrollable vertically. When the page refreshes, the scroll position returns to the top. The enhancement is to maintain the position of where ever the scrollbar is on postback. How do I keep the scrollbar position on post back?

2) Within each of the panels are dynamically added web controls. These web controls contain gridviews, which are themselves contained inside div tags. These div tags can be hiddened and made visible by an image button. This hidden and visible state is actioned by some javascript on the page. Again, the user has asked how it is possible to maintain the state of these div tags on post back, i.e. those that are closed and those that are visible. Currently, the state is on postback for all the div tags to be visible. How do I maintain the state of the visibility of a div tag during postback?

View 4 Replies

Forms Data Controls :: Maintaining Tab Position On Ajax Postbacks?

Jun 30, 2010

I have a grid and there are several dropdowns in a row of the grid.The dropdown selection change is driving other dropdowns in the row.

I put the dddls inside UpdatePanels still dropdowns are losing the tab position after a partial update. How is this generally done?

View 1 Replies

Forms Data Controls :: Maintaining Gridview Scroll In Ajax Update Panel With Masterpage?

Mar 1, 2010

I have seen alot of posts on the inetrnet with the solution to mainatin gridview scroll using an Ajax Update Panel.

Every solution I have seen though seems to have the same problem..as explained they dont work in content forms with master pages...at leat no solution I have seen has worked.

Does anyone know how to resolve this problem of using update panel to maintain gridview scroll with masterpages?

View 1 Replies

AJAX :: Set The Scroll Position To The Top?

Mar 17, 2011

i have a update panel and when a link button is fired i need to set the scroll position to the top. i need this to happen in the code behind, i have tried the following but it wont work.

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "srcoll_0", "window.scrollTo(0, 0);", true);

View 3 Replies

How To Remain Scroll Position Of A Panel

Aug 24, 2010

I have a panel, inside a panel there are some checkbox and radiobuttonlist. This panel is place inside an UpdatePanel ajax.

When I click on a checkbox, it will raise autopostback with ajax supported, then the scrollbar of the panel always move back to the first position. It does not keep the current scrolling position.

How could I remain the scrollbar position?

I already have tried to add:

this.Page.SetFocus("PanelTrips");
this.MaintainScrollPositionOnPostBack = true;

View 1 Replies

C# - Maintain Scroll Position On Autopostback?

Feb 28, 2011

how can I get back to the same position of a page on postback. It always seems to get to the top of the page
I've tried using ' maintainScrollPositionOnPostBack = "true" ' but its not working.

View 3 Replies

Web Forms :: Maintain The Scroll Bar Position?

Apr 7, 2010

i used the dropdown list in user control.when i select the dropdownlist that scroll bar went to top.how can i maintain the scroll bar position in that situation?

View 3 Replies

Listbox Scroll-bar Position Retention?

Jan 8, 2010

how would i get the listbox vertical scroll bar to keep its posisition on postback ?nb I only care about the listbox scroll-bar not page.

View 5 Replies

Maintain Scroll Position On Page?

Jun 7, 2010

I'm using MaintainScrollPositionOnPostback=true property but this doesn't seem to work with chrome. (works on IE),

Is there any other way to maintain scrool position without using this property?

View 1 Replies

Web Forms :: Set The Scroll Position Of A ListBox?

Aug 13, 2010

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.

View 4 Replies

Web Forms :: Scroll Position After Partial Postback?

Feb 1, 2010

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.

View 6 Replies

Web Forms :: How To Retain Scroll Position On Postback

Jul 23, 2010

How can we retain Panel scroll position on postback without using any cookies.

View 6 Replies

Web Forms :: Maintain Scroll Position Of Div In UserControl?

Sep 10, 2010

I have taken a div inside the UserContol.

this usercontrol is placed in a page having master page.

In div i have checkboxlist control .

I want to preserver scroll position of while postback.

I have also used UpdatePanel in which i have placed this user control.

I have also triedMaintainScrollPositionOnPostback="true"

but does not work.

My page structure is this:

Masterpage > contentplacehoder (child Page) > UpdatePanel > User control > div > asp:CheckboxList

View 4 Replies

Web Forms :: Maintain Scroll Position Of Page

Jul 19, 2010

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.

[Code]....

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.

View 8 Replies

Web Forms :: Set Scroll Position To Selected TreeNode?

Feb 11, 2010

I have this working in several pages in my site but in one page it wont work!

this is the hierarchyof the page.

I have a treeview in a div,in an asp:panel, in an updatepanel in a user control. the panel is shown/hidden using the ajax modalpopupextender.

this user control is placed in a content page (using a master page).

Now that you got the above, I'll let you know what ive tried already.

I tried doing this:(which works perfectly when the treeview is placed simply in an aspx page)

[Code]....

tried using also :

[Code]....

Basically i kept playing around with it trying different ways but seems like the selected node is just not visible even though i call this JS function after i have selected the Node in code behind.

View 2 Replies

Web Forms :: Scroll Down To A Position On Page In Page_Load

Sep 17, 2010

[Code]....

I am trying to use an anchor tag to automatically scroll down to "position1" when the page loads.

I have created this name tag in the .aspx page and then trying to redirect to that tag in the page_load event but this results in that the page doesn´t load at all and cant be seen in the browser:

View 5 Replies

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.

View 3 Replies

Web Forms :: Maintain DIV Scroll Position On PostBack?

Feb 21, 2014

[URL]

I have got the gridview to populate from my own datatable and there are quite a few results in the table. As a result I have a scroll bar on my gridview.

If there is only a few results the gridview works perfectly, however; When I select a row further down in the scroll it selects and highlights but refreshes the view to the top of the gridview.

View 1 Replies

Web Forms :: Preserve Scroll Position Of DIV On PostBack

Feb 28, 2014

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. 

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="SBN_Messages.aspx.vb"
Inherits="ShopBuyName_Test_Site.SBN_Messages" MaintainScrollPositionOnPostback="true" %>
<%@ Register Assembly="obout_Interface" Namespace="Obout.Interface" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

[code]....

View 1 Replies

Web Forms :: Maintain Scroll Position On Page Without Postback

Mar 11, 2010

I have some collapse able anhcor link tags on a page that reveal some text when clicked on i.e.: [+] Topic This is all done in javascript client side. I would like to maintain the users scroll position on the page when these links are clicked on. They dont cause a postback as iv mentioned above its client side javascript.

View 6 Replies

Javascript - How To Keep Whole Page Scroll Position After Asynchronous Postback

Oct 16, 2010

i am using asp.net 4.0 iis 7.5 microsoft visual studio 2010

what i want is keep whole page (browser) scroll position (not a div or panel) when asynchronous postback happened (update panel) how can i do this actually i had a function which can keep div scroll bar position after postback like this

<script type="text/javascript">
var xPos, yPos;
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_beginRequest(BeginRequestHandler);
prm.add_endRequest(EndRequestHandler);
function BeginRequestHandler(sender, args) {
xPos = document.getElementById('Main').scrollLeft;
yPos = document.getElementById('Main').scrollTop;
}
function EndRequestHandler(sender, args) {
document.getElementById('Main').scrollLeft = xPos;
document.getElementById('Main').scrollTop = yPos;
}
</script>

bu i could not find browser scroll bar id to get its values to get with document.getElementById

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved