dataview event handler

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i'm trying to make an event handler for my dataview but there does not seem
to be an option for it. i want the event handler to listen for key presses.
currently i have:


this.dvTypes += new System.EventHandler(this.dvKeyPress);

void dvKeyPress(object sender, System.Windows.Forms.KeyEventHandler e)
{
MessageBox.Show("Key Pressed");
}

this is being done in ADO .NET
 
Oscar:

One approach might be to create a new class, perhaps, MyDataView class,
which inherits from DataView, and then create your event in this new class.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.



i'm trying to make an event handler for my dataview but there does not seem
to be an option for it. i want the event handler to listen for key presses.
currently i have:


this.dvTypes += new System.EventHandler(this.dvKeyPress);

void dvKeyPress(object sender, System.Windows.Forms.KeyEventHandler e)
{
MessageBox.Show("Key Pressed");
}

this is being done in ADO .NET
 
A DataView isn't really a UI component, but is rather a data component.
Yes, it has a design time representation, but this is for design time
configuration of databound controls etc. The concept of KeyPress on a
DataView doesn't make sense. You have a KeyPress on a UI control, such as a
ComboBox or a DataGrid that is bound to the DataView, but no keypress on the
DataView itself.
 

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

Back
Top