Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2007

Tip: Looking for answers? Try searching our database.

Determining when value changed in DataGridViewCell from derived cl

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Oldman - 08 Jun 2007 15:37 GMT
I am not seeing a clean way from a derived DataGridViewCell to determine when
the value is changed.  The value changed event gets thrown in the
DataGridView not the cell.  What am I missing?
Kevin S Gallagher - 27 Jun 2007 21:43 GMT
A little late but would this be what you are after?

  Private Sub DataGridView1_CellValidating(ByVal sender As Object, ByVal e
As System.Windows.Forms.DataGridViewCellValidatingEventArgs) Handles
DataGridView1.CellValidating
     Dim CurrentCell As DataGridViewCell =
DataGridView1.Item(e.ColumnIndex, e.RowIndex)

     If CurrentCell.IsInEditMode Then
        Dim GridControl As Control = DataGridView1.EditingControl
        Console.WriteLine("------------------------------------")
        Console.WriteLine("Edited value ""{0}"" Former value ""{1}""",
GridControl.Text, DataGridView1.Item(e.ColumnIndex,
e.RowIndex).Value.ToString)
        Console.WriteLine("------------------------------------")
     End If
  End Sub

>I am not seeing a clean way from a derived DataGridViewCell to determine
>when
> the value is changed.  The value changed event gets thrown in the
> DataGridView not the cell.  What am I missing?
Oldman - 27 Jun 2007 21:56 GMT
Thanks for the response Kevin.  Your example is using an event in the
DataGridView.
I am writing a custom DataGridViewCell and I was trying to determine when
the value in my cell was changed.

> A little late but would this be what you are after?
>
[quoted text clipped - 18 lines]
> > the value is changed.  The value changed event gets thrown in the
> > DataGridView not the cell.  What am I missing?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.