Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 3rd, 2004, 10:09 PM
Authorized User
 
Join Date: Aug 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to humour
Default Programatically scroll from datagrid to a textbox

My windows form is in "form layout mode".

Essentially what I want to know how to do is using javascript or server side script (I am indifferent) I want my webpage to scroll to a text-box below my datagrid and setfocus within that textbox.

I have a paging datagrid that has an Edit Link/column (using the OnEdit handler) but I don't overlay textboxes inline on the grid... Instead I populate a form at the bottom part of page. I do this because some fields have lengthy data and I want to eventually use listboxes etc and I haven't figured out yet how to do them on the form. Within my OnEdit handler I set several textboxes with the data from the form, a button calls a method to do a database update.
 
Old August 4th, 2004, 12:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Client side in load event.

document.frmFormName.txtTextboxName.setfocus();

-----------------------------

Or server side:

txtTextboxName.Attributes.Add("onload", "document.frmFormName.txtTextboxName.setfocus( );")

-----------------------------

Also, doing a Google search on:

"setting the focus to a textbox using javascript"

will turn up several things for you.

J





Similar Threads
Thread Thread Starter Forum Replies Last Post
TextBox issues when created programatically nkommala ASP.NET 1.x and 2.0 Application Design 3 October 9th, 2006 11:59 PM
Datagrid scroll count (Lines) VB.NET 2003 peterasimpson VB.NET 4 November 24th, 2005 05:34 PM
Datagrid scroll count (Lines) VB.NET 2003 peterasimpson VB How-To 1 November 24th, 2005 12:33 AM
Datagrid - Scroll to selected item rodmcleay ASP.NET 1.0 and 1.1 Professional 2 February 21st, 2005 08:36 PM
How to display scroll bars for textbox at runtime harini19 VB How-To 1 September 30th, 2004 06:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.