Avatar of MzKitty
MzKitty
Flag for United States of America asked on

Gridview does not maintain row position after clicking edit

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
.NET Programming

Avatar of undefined
Last Comment
MzKitty

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
MzKitty

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck