A
AH
Hi all,
I noticed this strange behavior; I created a new control (example inherits
from textbox) and add a new property, then I bind this new property to a
field in my dataTable in a dataSet. After the binding statement, when I
check for dataset.getchanges ... it alway returns that there is changes
(even the propety just set the value and get the same value to return)... I
have tried to understand what has changed by using the rowversion.original
and rowversion.current to compare all fields but find evertything to be
exactly the same ...I wonder whatelse that getchanges has discovered that I
am not aware of ..??
however, if I bind it to a standard control like textbox, it is ok .... so
what is wrong here .. have I miss anything when creating the new control
?...or have getchanges discovered some strange items that I am not aware of
?? please help
Thank you ..
Albert
sample code:
--- for new controls ---
imports system.componentModel
public class NewControl
inherits system.windows.forms.textbox
private strVar as string
........
---
public property NewValue as string
Get
return strVar
Set (byval value as string)
strVar = value
End Set
End Property
End class
------------
for the binding
' set up the dataadapter .. dataset ... etc.
me.sqldataadapter1.fill(me.dataset11)
me.textbox1.databindings.add(new system.windows.forms.binding("text",
dataset11, "table1.Field1")
me.NewControl1.databinding.add(new
system.windows.form.binding("NewValue",dataset11,"table1.field2")
me.BindingContext(dataset11, "table1").EndCurrentEdit()
dim n as integer
if dataset11.getchanges is nothing then msgbox("noting") else
msgbox("changed")
I noticed this strange behavior; I created a new control (example inherits
from textbox) and add a new property, then I bind this new property to a
field in my dataTable in a dataSet. After the binding statement, when I
check for dataset.getchanges ... it alway returns that there is changes
(even the propety just set the value and get the same value to return)... I
have tried to understand what has changed by using the rowversion.original
and rowversion.current to compare all fields but find evertything to be
exactly the same ...I wonder whatelse that getchanges has discovered that I
am not aware of ..??
however, if I bind it to a standard control like textbox, it is ok .... so
what is wrong here .. have I miss anything when creating the new control
?...or have getchanges discovered some strange items that I am not aware of
?? please help
Thank you ..
Albert
sample code:
--- for new controls ---
imports system.componentModel
public class NewControl
inherits system.windows.forms.textbox
private strVar as string
........
---
public property NewValue as string
Get
return strVar
Set (byval value as string)
strVar = value
End Set
End Property
End class
------------
for the binding
' set up the dataadapter .. dataset ... etc.
me.sqldataadapter1.fill(me.dataset11)
me.textbox1.databindings.add(new system.windows.forms.binding("text",
dataset11, "table1.Field1")
me.NewControl1.databinding.add(new
system.windows.form.binding("NewValue",dataset11,"table1.field2")
me.BindingContext(dataset11, "table1").EndCurrentEdit()
dim n as integer
if dataset11.getchanges is nothing then msgbox("noting") else
msgbox("changed")