C
cjard
Suppose:
A TextBox is bound to a BindingSource, which is bound to a DataTable
A BindingNavigator is used to alter the current row being looked at by
the BindingSource
(i.e. Nav's NEXT button is pressed. BS.Position changes from 2 to 3,
Textbox was showing APPLE, now shows ORANGE)
Does the textbox receive any notification that this occurred? If so,
what?
I ask because I want to extend TextBox and add some extra properties.
When the textbox is showing an item off a DataRow whose .RowState is
Unchanged, i want to enable the TextBox. If the .RowState is Modified,
I want to make the TextBox disabled. If the .RowState is Added, I want
to make the Textbox ReadOnly.
If I can have the TextBox detect when the underlying row has changed
to another one, I can investigate the .RowState and change the state
of the TextBox accordingly.
Currently, I can implement this by hooking to the .PositionChanged
or .CurrentChanged events of the BindingSource, but I would prefer to
make it a TextBox internal thing
Thanks in advance
A TextBox is bound to a BindingSource, which is bound to a DataTable
A BindingNavigator is used to alter the current row being looked at by
the BindingSource
(i.e. Nav's NEXT button is pressed. BS.Position changes from 2 to 3,
Textbox was showing APPLE, now shows ORANGE)
Does the textbox receive any notification that this occurred? If so,
what?
I ask because I want to extend TextBox and add some extra properties.
When the textbox is showing an item off a DataRow whose .RowState is
Unchanged, i want to enable the TextBox. If the .RowState is Modified,
I want to make the TextBox disabled. If the .RowState is Added, I want
to make the Textbox ReadOnly.
If I can have the TextBox detect when the underlying row has changed
to another one, I can investigate the .RowState and change the state
of the TextBox accordingly.
Currently, I can implement this by hooking to the .PositionChanged
or .CurrentChanged events of the BindingSource, but I would prefer to
make it a TextBox internal thing
Thanks in advance