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


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 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

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

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

C# - Postback Not Maintaining Selected Values

Jun 19, 2010

I have a page with several dynamically generated DropDownLists. The DDs load and display the correct values on page load. However, when I try to retrieve the values at post back, the DDs all seem to be maintaining the values they had at page load.

All are created in Page_Load;

No test for IsPostBack;

Processing is handled in code below:

[Code]....

View 4 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

Ajaxcontroltoolkit - Maintaining ActiveTabIndex On Postback Within TabContainer

Sep 23, 2010

This probably has been asked many times before but I was wondering how to maintain the ActiveTabIndex of an AjaxControlToolKit TabContainer. The only way I can think of achieving such a thing is to store the ActiveTabIndex in the session and checking for this on postback. Are there any other solutions to solve this problem?

View 2 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 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

Web Forms :: Listbox Auto Postback - How To Maintain Scroll Position

Mar 11, 2010

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 am using .Net 3.5 but no AJAX.

View 6 Replies

Web Forms :: How To Maintain Scroll Position On Postback In Webpage In FireFox And Chrome

Feb 8, 2013

I tried some methods to maintain scroll position on postback but none worked they are

1) In page declaration MaintainScrollPositionOnPostback="true"

2) In Code behind  Page.MaintainScrollPositionOnPostBack = true

3)In web.config file in <system.web>  section <pages maintainScrollPositionOnPostBack="true" />

I am not using any updatepanel.

View 1 Replies

Forms Data Controls :: Maintaining Gridview Row Height?

Nov 4, 2010

while using gridview whenever I go to edit an item it increases the row size - but this is because I have a multiline textbox as one of the edititemtemplates. It also increases the size of every row to the same size as the one that is being edited. Is there any way to keep the rest of the rows the same initial height and have an increased size just for the row being edited?

View 5 Replies

Forms Data Controls :: Maintaining 12 Rows In A Gridview

Nov 27, 2010

I have a List box that displays my Vendors, and then I have a Gridview that shows payments made to those vendors. Is there any way of making the gridview always show 12 rows, regardless if 4 payments were made or even 0 payments have been made ?

View 2 Replies

Javascript - Scroll To Panel After Postback C#

Nov 19, 2010

How do i scroll to a panel within an updatepanel after i load the content

View 4 Replies

Forms Data Controls :: Maintaining Selected Values In DropDownList While Paging In GridView

Jan 8, 2011

I have a problem with keeping the selected values in DropDownLists in rows in GridView while paging. I have this code behind:

private void RememberOldValues()
{
ArrayList LinijaIDList = new ArrayList();
int index = -1;
foreach (GridViewRow row in GridView1.Rows)
{
index = (int)GridView1.DataKeys[row.RowIndex].Value;
if (Session["equal_ITEMS"] != null)
LinijaIDList = (ArrayList)Session["equal_ITEMS"];
if (row.Cells[0].Text == lineTextBox.Text)
{
if (!LinijaIDList.Contains(index))
LinijaIDList.Add(index);
}
else
LinijaIDList.Remove(index);
}
if (LinijaIDList != null && LinijaIDList.Count > 0)
Session["equal_ITEMS"] = LinijaIDList;
}
protected void Button1_Click(object sender, EventArgs e)
{
//Session["equal_ITEMS"] = null;
RememberOldValues();
GridView1.AllowPaging = false;
BindGrid();
//RePopulateValues();
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("LinijaID", typeof(int)));
dt.Columns.Add(new DataColumn("Ime", typeof(string)));
ArrayList LinijaIDList = (ArrayList)Session["equal_ITEMS"];
//if (LinijaIDList!=null)
//{
foreach (int LinijaID in LinijaIDList)
{
foreach (GridViewRow row in GridView1.Rows)
{
DropDownList Ime = GridView1.FooterRow.FindControl("ImeDropDownList") as DropDownList;
int rowID = (int)GridView1.DataKeys[row.RowIndex].Value;
//string Name = row.Cells[1].Text;
string Name = Ime.SelectedValue;
if (rowID == LinijaID)
{
DataRow dr = dt.NewRow();
dr["LinijaID"] = LinijaID;
dr["Ime"] = Name;
dt.Rows.Add(dr);
}
}
}
GridView1.AllowPaging = true;
Session["equal1"] = dt;
Response.Redirect("CheckedRowsPage1.aspx");
}
// else
//{
// GridView1.AllowPaging = true;
// Session["equal1"]=null;
// }
}

When I insert a value in the TextBox2 and want to select only the rows from the GridView from different pages which have value in the first column the same as the value in the TextBox2, after clicking on Button1 I get this error:

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

[Code]....

View 3 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

Updatepanel - Maintain Panel Scroll Position On Partial Postback?

Mar 13, 2011

I have a gridview that putted in ASP.NET Panel. both of panel and Gridview are in an UpdatePanel. there is a column in gridview that Causes Partial PostBacks. i want to Maintain Panel Scroll position on those postbacks.

View 1 Replies

Forms Data Controls :: To Add Insert Button To A GridView And A Scroll Bar To A Given Gridview Column?

Jul 9, 2010

how to implement Insert feature to a grid view?I need to use fields with scroll bar inside of a grid view. Is that possible through the template field?

View 23 Replies

State Management :: Maintaining Viewstate On Gridview With Controls?

Jan 14, 2011

I have a gridview with results from a database query and columns where I add linkbuttons to individual cells.

something like:

Dim LB2 As New LinkButton

LB2.Text = "title"
LB2.CommandArgument = "argument"

AddHandler LB2.Click, AddressOf LaunchDocument

GridView1.Rows(i).Cells(10).Controls.Add(LB2)

There is a lot time involved in determining what cells get the linkbutton and I want to avoid going through that process on a postback when a user clicks one of the linkbuttons.How can I maintain these controls in the gridview after a user clicks a linkbutton and a postback is done?Right now the application has to go through the process all over again.

View 6 Replies

Forms Data Controls :: Gridview Horizontal Scroll

Jun 9, 2010

I have a gridview with around 250 columns which are generated automatically except first column which is fixed. Is there any way I can fix the first column but allow horizontal scrolling on remaining columns.

I have only 6 rows in gridview so don't need vertical scroll.Here is my code.

<div id="dvShipmentGrid" style="width: 1000px; padding-right: 10px;

View 3 Replies

Forms Data Controls :: Scroll A Gridview Horizontally?

Oct 8, 2010

i need to scroll my gridview horizontally but not vertically.I have tried many solution but either it is fixed or scrolling bothways.

View 7 Replies







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