Handling the focus in a custom control inside a datagrid cell 
Author Message
 Handling the focus in a custom control inside a datagrid cell

Hi all,

I created a custom control composite by two textboxes. I putted this control inside a datagrid cell, using the TextBox.Controls.Add method of a DataGridTextBoxColumn object, binded to the grid's TableStyle.

I want to allow the user to enter data in the first textbox, press Tab, and enter data in the second textbox. When he presses tab again, the focus will change to the next cell.

But when the user are editing the cell and press tab to set the focus to the second textbox, the focus goes to the second cell, not to the second textbox of my custom control.

How can I maitain the focus inside my custom control until the the last control loses the focus?

Thanks in advance,

Fabrcio de Novaes Kucinskis.



Sat, 29 Oct 2005 01:37:58 GMT  
 Handling the focus in a custom control inside a datagrid cell
The only thing I can think of is to use a client-side script
combined  DHTML  to capture the   OnKeyUp event.    Your
function be  associated to your custom control.  IT will
analyze the event  and the key that was pressed.   If
it is a tab key and its on the first textbox,  put the focus in
the second textbox and prevent the event  from bubbling
up (to the containing control).
This is just an idea since I never did this before.  You
can search gooble or a dhtml sample.

HTH

Elrey Ronald V.

Please NOTE:    In my effort to reduce e-mail spam, you can
only reply directly  by  removing 'NOSPAM'  portion  in  my
e-mail address.  Thank you for understanding.



Hi all,

I created a custom control composite by two textboxes. I putted this control
inside a datagrid cell, using the TextBox.Controls.Add method of a
DataGridTextBoxColumn object, binded to the grid's TableStyle.

I want to allow the user to enter data in the first textbox, press Tab, and
enter data in the second textbox. When he presses tab again, the focus will
change to the next cell.

But when the user are editing the cell and press tab to set the focus to the
second textbox, the focus goes to the second cell, not to the second textbox
of my custom control.

How can I maitain the focus inside my custom control until the the last
control loses the focus?

Thanks in advance,

Fabrcio de Novaes Kucinskis.



Mon, 31 Oct 2005 13:14:21 GMT  
 Handling the focus in a custom control inside a datagrid cell
Thank you, Elrey, but I'm working with the WinForms datagrid, not the
WebForms.

I didn't find a solution, so I'm changing my interface to use another kind
of control.
Thanks again,

Fabrcio.



Quote:
> The only thing I can think of is to use a client-side script
> combined  DHTML  to capture the   OnKeyUp event.    Your
> function be  associated to your custom control.  IT will
> analyze the event  and the key that was pressed.   If
> it is a tab key and its on the first textbox,  put the focus in
> the second textbox and prevent the event  from bubbling
> up (to the containing control).
> This is just an idea since I never did this before.  You
> can search gooble or a dhtml sample.

> HTH

> Elrey Ronald V.

> Please NOTE:    In my effort to reduce e-mail spam, you can
> only reply directly  by  removing 'NOSPAM'  portion  in  my
> e-mail address.  Thank you for understanding.



> Hi all,

> I created a custom control composite by two textboxes. I putted this
control
> inside a datagrid cell, using the TextBox.Controls.Add method of a
> DataGridTextBoxColumn object, binded to the grid's TableStyle.

> I want to allow the user to enter data in the first textbox, press Tab,
and
> enter data in the second textbox. When he presses tab again, the focus
will
> change to the next cell.

> But when the user are editing the cell and press tab to set the focus to
the
> second textbox, the focus goes to the second cell, not to the second
textbox
> of my custom control.

> How can I maitain the focus inside my custom control until the the last
> control loses the focus?

> Thanks in advance,

> Fabrcio de Novaes Kucinskis.



Tue, 01 Nov 2005 20:39:49 GMT  
 Handling the focus in a custom control inside a datagrid cell
Can you handle the GotFocus to the next controls instead of handle the
KeyUp?



Quote:
> The only thing I can think of is to use a client-side script
> combined  DHTML  to capture the   OnKeyUp event.    Your
> function be  associated to your custom control.  IT will
> analyze the event  and the key that was pressed.   If
> it is a tab key and its on the first textbox,  put the focus in
> the second textbox and prevent the event  from bubbling
> up (to the containing control).
> This is just an idea since I never did this before.  You
> can search gooble or a dhtml sample.

> HTH

> Elrey Ronald V.

> Please NOTE:    In my effort to reduce e-mail spam, you can
> only reply directly  by  removing 'NOSPAM'  portion  in  my
> e-mail address.  Thank you for understanding.



> Hi all,

> I created a custom control composite by two textboxes. I putted this
control
> inside a datagrid cell, using the TextBox.Controls.Add method of a
> DataGridTextBoxColumn object, binded to the grid's TableStyle.

> I want to allow the user to enter data in the first textbox, press Tab,
and
> enter data in the second textbox. When he presses tab again, the focus
will
> change to the next cell.

> But when the user are editing the cell and press tab to set the focus to
the
> second textbox, the focus goes to the second cell, not to the second
textbox
> of my custom control.

> How can I maitain the focus inside my custom control until the the last
> control loses the focus?

> Thanks in advance,

> Fabrcio de Novaes Kucinskis.



Mon, 14 Nov 2005 18:25:52 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Handling the focus in a custom control inside a datagrid cell

2. Focus of constituent control inside custom control

3. DropDown List (ComboBox stile) inside a DataGrid cell

4. set focus in a datagrid cell

5. Datagrid Cell Focus

6. Datagrid: getting focus back in cell automatically after scrolling

7. set focus in a datagrid cell

8. set focus in a datagrid cell

9. Showing a custom context menu on DataGrid Cell

10. Cannot shift focus from custom control to other control

11. control focus inside web page

12. ActiveX control inside a class + handling its events ??

 

 
Powered by phpBB® Forum Software