Focus on a control

  • Thread starter Thread starter Roberto\(DOTNET\)
  • Start date Start date
R

Roberto\(DOTNET\)

Hi at all,
i have a little problem.
In a simple web page aspx i have a DataGrid (..WebControls.DataGrid) and
some others web controls (edits and buttons). The datagrid control is usad
to display some rows.
How i can put focus on the first row of datagrid? all of this in vbnet
obviously.

thanks in advance
roberto
 
Roberto,

I never saw a method for this. The only thing I could do was add a little
piece of javascript at the end of the aspx page (problem is that it cannot
in the load event otherwise you could do it using VBNet)

<INPUT tabindex="1" id="fieldid" type="text" size="27">

//This should be the last rows in your html aspx file

<script language="JavaScript">
document.all("fieldid").focus();
</script>
</HTML>

However maybe somebody has a better idea.

When not than I hope this helps a little bit?

Cor
 
Back
Top