Solved

Gridview does not maintain row position after clicking edit

Posted on 2012-03-16
1
431 Views
Last Modified: 2012-03-16
Hi. I have a gridview in a panel in an updatepanel and in a div on a webpage.  The user does not want paging in the gridview, so I have scroll controls in the panel.  When the I click Edit on the row I want to change, the gridview goes to the first row after the postback.

 I have set MaintainScrollPositionOnPostBack = True in the asp page :

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="InvCount.aspx.vb" Inherits="BuildingMaterials.InvCount" MaintainScrollPositionOnPostback="true"  %>

and in the SelectedIndexChanged sub:

Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles GridView1.SelectedIndexChanged

        GridView1.SelectedRow.Controls(0).Focus()
    End Sub

What else can I do?

Thanks,
Cathy
0
Comment
Question by:MzKitty
1 Comment
 

Accepted Solution

by:
MzKitty earned 0 total points
ID: 37730521
I took the panel out of it so and that fixed it.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now