Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello again all, I just finished t

Status
Not open for further replies.

smithbr

MIS
May 29, 2003
85
0
0
US
Hello again all,
I just finished this VB.net program I was working on and started testing it when I noticed a huge hole in it that some how I missed from the beginning.

I have a datagrid that is filled based on a access DB. The columns that are in the datagrid include: lineseqno, itemnumber, quantity, unit price, and discount %. I also have a column that is created at run time called Total that is quantity * unit price.

Now to my question: How can I either get the total column to update to the database even though it is not part of the dataset. (I created the DA and DS at design time) If that will not work, how can I get the unit price to change based on if a radio box is selected(if a discount was taken). I am not sure how to do this either way..and both I think will fit my purpose. Any suggestions?
Thanks.
 

Try this!!!

Private Sub onRadioButton1CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
If RadioButton1.Checked = True Then
MessageBox.Show(DataGrid1.Item(DataGrid1.CurrentRowIndex, 0) - yourDiscountAmount)
End If
End Sub

Tweak the code as per your requirement

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top