Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

C#

are these typical events that any grid would have - even the standard net
2.0 grids?

when the user goes into a cell and changes it...

a.) before that cell actually changes, is there a before_update event, that
can save the value of whatever was
there or do whatever else we may need.

b.) after that cell is updated to the new value, fire off another event that
goes and does something ...
in this case it would look for stuff in a database matching that value...

thanks,
greg
0
gsgi
Asked:
gsgi
1 Solution
 
udhayakumardCommented:
Hi,

Try this events..............

this.dataGridView1.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.dataGridView1_CellBeginEdit);
           
this.dataGridView1.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellEndEdit);
       

private void dataGridView1_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
{
             MessageBox.Show(dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString());
}

private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
              MessageBox.Show(dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString());

}    
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now