.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Post New Resource Bookmark and Share   

Set the focus to the first item template control in the grid view using javascript.

Posted By:Mihir Soni       Posted Date: February 03, 2011    Points: 15    Category:    URL: http://www.dotnetspark.com  

This code snippets will help you to focus your gridview controls in Edit item template. So that you can use tab functionality
 

Hello,

Please write following code in javascript and just call it on page load event.

function window_onload()
{

var gridViewID = "<%=gvDoc.ClientID %>";
var gridView = document.getElementById(gridViewID);
var gridViewControls = gridView.getElementsByTagName("input");
if (gridViewControls[0].type == "text")
{
gridViewControls[0].focus();
}
}


Thank you

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend