By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,786 Members | 1,131 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,786 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jun 27 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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

"fo*******@hotmail.com" wrote:
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
Jun 27 '08 #2

P: n/a
On Jun 11, 10:49 pm, foolme...@hotmail.com wrote:
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
Jun 27 '08 #3

P: n/a
On Jun 12, 3:38*am, Manish <Man...@discussions.microsoft.comwrote:
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

"foolme...@hotmail.com" wrote:
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- Hide quoted text -

- 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
Jun 27 '08 #4

P: n/a
On Jun 12, 5:50*am, marss <marss...@gmail.comwrote:
On Jun 11, 10:49 pm, foolme...@hotmail.com wrote:
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) ;

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
Jun 27 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.