Reputation: 131
After binding object to Richtextbox using bindingsource, if i type anything inside the textbox cursor will move to beginning. Can someone please help me.
I am binding as below
this.txtDescription.DataBindings.Add("Text", bindingWard, "Description",
false, DataSourceUpdateMode.OnPropertyChanged);
Upvotes: 2
Views: 1159
Reputation: 81620
Try changing the DataSourceUpdateMode to OnValidation:
this.txtDescription.DataBindings.Add("Text", bindingWard, "Description",
false, DataSourceUpdateMode.OnValidation);
If you want to keep the OnPropertyChanged setting, you can try changing the ControlUpdateMode, which is sort of a way to create a one-way binding:
Binding b = new Binding("Text", test, "Description",
false, DataSourceUpdateMode.OnPropertyChanged);
b.ControlUpdateMode = ControlUpdateMode.Never;
this.txtDescription.DataBindings.Add(b);
Upvotes: 2