Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to retain scroll position in Datagrids?

Status
Not open for further replies.

DLLHell

Programmer
May 9, 2003
69
0
0
US
What would be the best method to re-display a datagrid as-is (i.e. when an error occurred in a Edit textbox) without having the grid re-display starting at the first row?

Thanks for any info or suggestions on this.
 
As long as viewstate is enabled (which is the default) a datagrid will not repopulate itself from a postback.

Are you trapping any errors so the user stays on the current page? This would be my recommendation.
 
I have the grid's EnableViewState=false and I am using
<%@ Page SmartNavigation=&quot;true&quot; %>

That works well in the Update event however when the Edit event finishes it will not show the Edit textboxes unless I repopulate the datagrid. Any idea how to force it to show the textboxes without having to repopulate the grid?
 
I would recommend setting EnableViewState = True. This should give you what you are looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top