Subscribe to Subscribers
Talk to Webmaster Tony John

Online Members

Priya jain
Gopi
More...

Forums » .NET » Windows »

Manimulate records in datagridview from vb.net windows form


Posted Date: 26 Jun 2012      Posted By:: John     Member Level: Bronze    Member Rank: 1745     Points: 5   Responses: 1



I have a subform in Access where I input records.
Next to each record there is a button that the data in the record can
to change.

In vb.net windows form I have a datagrid that I can fill
of records. It is possible to, as in access, each time a
record is loaded in the datagridview, in addition to the data grid also displays a button that, when pressed by the user, the data in a field of the record changes?


Dim I As Integer
ItemLoc Dim As Integer = -1
For I = 0 To DGV2.Rows.Count - 1

If R.Scannummer DGV2.Rows = (I). Cells (0). Value Then


'Item found
ItemLoc = I
Exit For
end If
Next
'If item is not found, add it
If ItemLoc = -1 Then
DGV2.Rows.Add (R.Scannummer, R.ProductId, R.Productomschrijving, R.CategorieId, R.Productnaam, R.KleurId, R.MaatId, R.Verkoopprijs, 1, R.Verkoopprijs)
else
'If item is already there increasefontsize its count
Item Dim Count As Long = CLng (DGV2.Rows (ItemLoc). Cells (8). Value)
Item Count = 1
Dim newPrice As Decimal = CDec (R.Verkoopprijs * Item Count)
DGV2.Rows (ItemLoc). Cells (8). Value = Item Count
DGV2.Rows (ItemLoc). Cells (9). Value = newPrice
end If


Grateful,

John




Responses

#677810    Author: John      Member Level: Bronze      Member Rank: 1745     Date: 27/Jun/2012   Rating: 2 out of 52 out of 5     Points: 1

I've found it. I put a button in the grid, and worked with the cellcontentclick event.

Txs ,

John



 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : Api for windows authentication
Previous : Authenticate Ad login with active directory
Return to Discussion Forum
Post New Message
Category:

Related Messages
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.