Changing datagrid cell focus

  • Thread starter Thread starter richilli
  • Start date Start date
R

richilli

Hello

I have a datagrid bound to a dataset and on first display the focus
automatically goes to the first row first cell. I have code that will
allow me to navigate up and down the grid using the arrow keys but
when i first show the grid i cannot use the keys because the focus is
on the cell. If I click to the left with the mouse the focus switches
to the row thus allowing me to use the arrow keys.

How do I programatically change the focus on page load from datagrid
cell to datagrid row thus allowing me to use the arrow keys.

Any help would be very much appreciated!!

Thanks

R
 
Richilli,

Maybe you biggest problem is that you can actually do nothing when the page
is not activated, try it in that event, in the pageload event it is just
building.

I hope this helps?

Cor
 
Thanks Cor

I should have stated i'm using the datagrid in a windows application
but thanks for your help.

R
 
Richili,

You were talking about pages, that means directly webforms in these
newsgroups.

This problem is simple, not tested however after the load event, so by
instance in the activate event you can do.

Mydatagrid.focus or set the index 0 on the datagrid.

I hope this helps?

Cor
 
Back
Top