How to focus a cell of a gridview inside an UpdatePanel (AJAX)

F

foolmelon

Before AJAX, we were able to focus a cell in a gridview during a
fullpage postback. After putting the gridview inside an UpdatePanel,
we cannot focus a cell in this gridview anymore. Does anybody know if
it is possible to make such focus? Thanks!

Bill
 
M

Manish

Hello Bill,

I could not really understand, how you want to have focus in the cell of the
Grid. You can access the cell in the RowDataBound event and then set the
focus.

e.row.cell(0).focus()

Could you please send me the code snippet that you were using earlier to
focus on the cell in the grid, which does not seem to be working fine when
the Grid is in the UpdatePanel?

Regards,
Manish
www.ComponentOne.com
 
M

marss

Before AJAX, we were able to focus a cell in a gridview during a
fullpage postback. After putting the gridview inside an UpdatePanel,
we cannot focus a cell in this gridview anymore. Does anybody know if
it is possible to make such focus? Thanks!

Bill

Hi Bill,

Try this:
ScriptManager.GetCurrent(this.Page).SetFocus(cell);

Mykola
http://marss.co.ua - Casual ideas for web development
 
F

foolmelon

Hello Bill,

I could not really understand, how you want to have focus in the cell of the
Grid. You can access the cell in the RowDataBound event and then set the
focus.

e.row.cell(0).focus()

Could you please send me the code snippet that you were using earlier to
focus on the cell in the grid, which does not seem to be working fine when
the Grid is in the UpdatePanel?

Regards,
Manishwww.ComponentOne.com






- Show quoted text -

Thank you for the reply Manish. Focus() works on a control, but not a
cell in a gridview. We need to use javascript to focus a cell.
However once the gridview is in an UpdatePanel, then the javascript
stop working. It is too complicate to post the code here.

Bill
 
F

foolmelon

Hi Bill,

Try this:
ScriptManager.GetCurrent(this.Page).SetFocus(cell);

Mykolahttp://marss.co.ua- Casual ideas for web development

Thanks for the reply. I tried SetFocus() from ScriptManager. I works
with almost all the controls, but not the cell inside a gridview.

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top