How to lock a textbox to a cell?

johmolan

Well-known member
Joined
Oct 11, 2008
Messages
129
Programming Experience
Beginner
Hi,

I have a windowsform in visual studio 2008, I connect to a ms sql-server
On my form I have a datagridview who I use to enter data etc and save them to the database. I then have textboxes who shows the sum of the columns etc in the table abd save that value back to the database. but for instance if i put the cursor in row 2 of the datagrid the values in theese textboxes dissapear.

What I want to know is if there is apossibility to lock the textbox to

ex. table test, clomn x and row 1??
 
what I think is strange is that I have bound the values for variable like this:

VB.NET:
Total_fortj2 = Prosess_140DataGridView.Item(42, 0).Value

Then I thought maybe I can bind the textbox.text like this as well.

But I do not know if anyone has tried it like that before?
 
That's not binding. That's simply getting a property value and assigning it to a variable, which is exactly what I meant when I suggested doing it manually. Binding means setting up a relationship so that a change in one place causes a change in another place without your having to write code to do it.
 
Back
Top