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

  • Thread starter Thread starter foolmelon
  • Start date Start date
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
 
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
 
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
 
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
 
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
 
Back
Top