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.
Ken Tucker [MVP] - 31 Jan 2005 13:04 GMT
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/default.asp?url=/library/en-us/dv_vstechart/ht
ml/vbtchformattingwindowsformsdatagridvisualbasicprimer.asp
http://msdn.microsoft.com/library/default.asp?url=/library/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.