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

DataGrid Key Processing Comes Unhinged

P: n/a
I'm trying to implement a "floating textbox" in a datagrid and seeing
some odd results.

In my override for DataGridTextBoxColumn.Edit, I create a custom
textbox that inherits from Textbox. I don't call edit for the base
class. I set the CustomTextBox.Parent to
Me.DataGridTableStyle.DataGrid.Parent. The "parent" is a panel that
the datagrid lives on. This seems to allow the CustomTextBox to
capture all the normal edit keys without having them picked up by the
datagrid.

The problem comes when I'm done editing with the custom text box. I
handle this in the Leave event for the custom text box. I've tried
setting the parent to nothing and also disposing of the custom
textbox. What I'm seeing is that all key processing for the datagrid
seems to be disabled from that point onward. I'm overriding
ProcessCmdKey for the datagrid and I don't get any keys picked up
there once I'm done editing in the custom textbox.

I've spent a long time trying to get this to work and would greatly
appreciate any help. I've got the floating textbox example from
Syncfusion but it does not do what I need.

Thanks Much,
Gene H.
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.