Re: Cell Contents ...Almost
- From: "Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx>
- Date: Wed, 29 Nov 2006 05:18:26 +0100
Arne,
If you read Add in Net you can be surethat it is about a collection.
Therefore you are adding everytime a binding at every click.
The way you solve that is up to you, either outside your method, using a
test if the collection is more than 1, or use a static boolean. (I prefer
the first one).
Secondly don't forget to do a bidingsource EndEdit (version 2.0) or a
currencymanager EndCurrentEdit (version 1.1), to push the data down at the
click event, this is only done automaticly at a row change, but that is not
with a textbox.
I hope this helps a little bit.
Cor
"Arne Beruldsen" <ArneBeruldsen@xxxxxxxxxxxxxxxxxxxxxxxxx> schreef in
bericht news:15CF9995-E7B6-4B75-A006-7586A89F6278@xxxxxxxxxxxxxxxx
Robin...
I added this line of code at the Cell Click Event...
TextEdit11.DataBindings.Add("Text", SxTable, "LastName", True)
Two problems...
1. It takes the "LastName" from the first record and not from the cell
selected
2. If I hit another cell....I get this error message "This causes two
bindings in the collection to bind to the same property."
Thanks for your help...
Arne
"RobinS" wrote:
If you are populating the textbox with the same columns all the time,
you can bind your datagrid to a BindingSource, then bind the
BindingSource to the DataSet.
Then you can bind the textbox to the same BindingSource. I
believe if you do this, when you pick an entry in the grid, it will
automatically update the textbox with the value in that row.
Dim nwData as CustomersDataSet = CustomersDataSet.GetCustomers()
m_CustomersGrid.DataSource = nwData
m_CustomersGrid.DataMember = "Customers"
Dim table as DataTable = nwData.Customers
m_CustomerTextBox.DataBindings.Add("Text", table, "CustomerID", True)
Robin S.
--------------------------------------------------------------
"Arne Beruldsen" <ArneBeruldsen@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:8271EF84-0CFB-462A-9B42-2650C216F393@xxxxxxxxxxxxxxxx
in vbnet2005 I have a datagridview. When the user clicks on a row...I
would
like the contents of certain cells to populate a textbox. To do
this...i
need to be able to refer to the row and colums...something like
textbox = contents (rx, cx)
How can I refer to the cell contents?
Thanks....
.
- Prev by Date: Re: Help - Timing Logic
- Next by Date: Re: Newbie Question here
- Previous by thread: RE: How to update .NET Development Environment to import a new namespa
- Next by thread: Re: Cell Contents ...Almost
- Index(es):
Relevant Pages
|