I have created an aplication in C# windows application version 1.1 to display some records in a datagrid.
The datasource of the datagrid is datatable and not any database.I want tht when we edit any cell of a particular column
and press "Enter" it should show a Message Box let's say "the cell is edited."
I wrote this but its not working
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue.ToString()=="Enter")
{
// When the user presses both the 'Alt' key and 'F' key,
// KeyPreview is set to False, and a message appears.
// This message is only displayed when KeyPreview is set to True.
this.KeyPreview = false;
MessageBox.Show("KeyPreview is True, and this is from the FORM.");
}
}
Can anybody have any idea?
bhavna_816 0 Junior Poster
covertx 0 Newbie Poster
bhavna_816 0 Junior Poster
PARAS PATEL 0 Newbie Poster
vari.maniya 0 Newbie Poster
Tor Sverre 0 Newbie Poster
Reverend Jim 4,968 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.