datagrid contents changed

  • Thread starter Thread starter coderazor
  • Start date Start date
C

coderazor

My user amends text in a datagrid. When this happens i want a Save button
that currently has enabled set to false to become enabled.

I have been messing around with the CurrentCellChanged event, however this
activates the button just by clicking within the grid.
I want the button to only become enabled when text within the grid is
changed.

How can i do this?.....

many thanks in advance.
 
Hi,

First add a tablestyle to the datagrid then I would add a handler to
the datagridtextboxcolumns textbox textchanged event.

Add Tablestyle
http://msdn.microsoft.com/library/d...tingwindowsformsdatagridvisualbasicprimer.asp

http://msdn.microsoft.com/library/d...ry/en-us/dnwinforms/html/wnf_custdatagrid.asp

Add a handler to textchanged event

Dim colName As New DataGridTextBoxColumn

With colName

..MappingName = "LastName"

..HeaderText = "Name"

..Width = 100

End With

AddHandler colName.TextBox.TextChanged, AddressOf TextBox_TextChanged



Private Sub TextBox_TextChanged(ByVal sender As Object, ByVal e As
System.EventArgs)

'Enable button here

End Sub



Ken

------------------------

My user amends text in a datagrid. When this happens i want a Save button
that currently has enabled set to false to become enabled.

I have been messing around with the CurrentCellChanged event, however this
activates the button just by clicking within the grid.
I want the button to only become enabled when text within the grid is
changed.

How can i do this?.....

many thanks in advance.
 
Back
Top