473,395 Members | 2,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Paste into bound textbox

Not sure why this is an issue, but apparently when you paste a string into a
textbox that is bound to a dataset/datasource, it does not save into the
dataset. I've tried several things including moving the
BindingContext.Position but I haven't found an easy way short of handling
updating the dataset manually.

Anyone have any experience with this and how to get around it?

-Howard

--
-----------------------------------------------
Howard Minor
Software Engineer
ho****@medcomsolutions.com
814.833.8481
Nov 20 '05 #1
7 1220
Howard,

Mostly
Bindingcontext(dataset/datasource).endcurrentedit

I hope this helps?

Cor
Nov 20 '05 #2
Thanks for the quick and good response. The pasting works but what about
this scenario:

textbox1.text = textbox1.text & " new string appended"

Doesn't seem to commit that to the datasource.

hmmm...
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:uw*************@TK2MSFTNGP12.phx.gbl...
Howard,

Mostly
Bindingcontext(dataset/datasource).endcurrentedit

I hope this helps?

Cor


Nov 20 '05 #3
Hi Howard,

I am not sure, can you try it yourself by showing the textbox first, a lot
of things to the controls start when the control is showed.

textbox1.show

Give a message when it works and as well when not?

Cor

textbox1.text = textbox1.text & " new string appended"

Doesn't seem to commit that to the datasource.

hmmm...

Nov 20 '05 #4
Thanks again...

It's already well visible as the form is loaded. I basically have a bound
textbox and a button next to it. The button opens another module that just
returns a string selected from another form. The code then appends the new
string to the existing in the textbox using that code below. I've tried the
..AppendText function too with the same result.

The bound dataset does not update and does not show any changes. I have to
manually click in the textbox and type something for it to register.

I do have it set to multiline if that matters...

-How
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Howard,

I am not sure, can you try it yourself by showing the textbox first, a lot
of things to the controls start when the control is showed.

textbox1.show

Give a message when it works and as well when not?

Cor

textbox1.text = textbox1.text & " new string appended"

Doesn't seem to commit that to the datasource.

hmmm...


Nov 20 '05 #5
On Mon, 26 Jul 2004 14:57:11 -0400, "Howard Minor"
<ho****@medcomsolutions.com> wrote:
Thanks again...

It's already well visible as the form is loaded. I basically have a bound
textbox and a button next to it. The button opens another module that just
returns a string selected from another form. The code then appends the new
string to the existing in the textbox using that code below. I've tried the
.AppendText function too with the same result.

The bound dataset does not update and does not show any changes. I have to
manually click in the textbox and type something for it to register.

I do have it set to multiline if that matters...


Had the same problem. I found just focusing the textbox forced it to update
the dataset table.

ie:

textbox1.text = "new text"
textbox1.focus()

Works but there is probably a more "correct" way to it. (I'm only just
learning VB myself :) )

Steve

Nov 20 '05 #6
Hi Howard,

In addition to Steve,

Normally it is better to update the datasource and not the control.

You can use the currencymanager (has nothing to do with money, manages the
current used row) for that, if you do not know how to use that message
than, than I make a very small sample.

I hope this helps?

Cor
Nov 20 '05 #7
Thanks, I ended up just updating the datasource rather than the control.
That makes more sense anyway.

Good tip on the focus though. I didn't think of that either.

Thanks again for the help,
Howard
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi Howard,

In addition to Steve,

Normally it is better to update the datasource and not the control.

You can use the currencymanager (has nothing to do with money, manages the
current used row) for that, if you do not know how to use that message
than, than I make a very small sample.

I hope this helps?

Cor

Nov 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Legendary Pansy | last post by:
I was checking out the 101 C# Samples, specifically Windows Forms - Use the Clipboard. I took a look at the code for a while, and I understand what the program is doing with the cut, copy, pasting...
8
by: Dennis C. Drumm | last post by:
Is there a way to modify the standard context menu shown when someone right clicks in a windows text box and that would work for all open windows applications? The standard context menu for...
2
by: Microsoft | last post by:
I'm not sure which control to use for this: I would like the user to be able to paste a list of items into a box and then be able to run through them one at a time. Hopefully there is a control...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
0
by: colleen1980 | last post by:
Hi: There are two textboxs in my main form. One is bound and another is unbound. There is no entry in the unbound textbox as values come into automatically after entering some information in the...
17
by: Steve | last post by:
I'm trying to code cut, copy, and paste in vb 2005 so that when the user clicks on a toolbar button, the cut/copy/paste will work with whatever textbox the cursor is current located in (I have...
2
by: cjard | last post by:
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...
11
by: John | last post by:
Hi In a winform app I need to provide a menu with Cut, Copy and Paste options., What code do I use to accomplish cut, copy and paste features for fields on a winfrom? Thanks Regards
0
by: Mike | last post by:
So here's the situation (.NET 2.0 btw): I have a form, and on this form is a textbox among many other databound controls. The textbox is bound to a field in a data table via the Text property. ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.