problem with datagrid

hi all,

I am new to VB.NET
im developing an accounts software
how would I do multiple in datagrid cell betwen qty and amount
and also to calculate it's total

any information you can give me would be helpful.
Thank's

Comments

  • : hi all,
    :
    : I am new to VB.NET
    : im developing an accounts software
    : how would I do multiple in datagrid cell betwen qty and amount
    : and also to calculate it's total
    :
    : any information you can give me would be helpful.
    : Thank's
    :
    ===================================================

    I'm new to VB.net too, one of my module subjects at university. :-)
    What do you mean by "muliple", did you mean multiply?
    I am guessing you are after total=quantity times the amount?

    Anyway you could try the following example,i think this is what your aiming towards is the following.
    I have done a simple example with textboxes instead of datagrids.
    ( I haven't looked at DataGrids yet to be honest ).

    In the example below the two buttons are named

    btnExit
    btnCalculate

    Text boxes are named

    txtQuantity
    txtAmount
    txtTotal


    Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
    Dim Total As Double
    If TxtQuantity.Text = "" Then TxtQuantity.Text = "0"
    If txtAmount.Text = "" Then txtAmount.Text = "0"

    Total = CDbl(TxtQuantity.Text) * CDbl(txtAmount.Text)
    txtTotal.Text = CStr(Total)
    End Sub

    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
    End
    End Sub

    Hope this helps?

    Notes:
    CSTR converts to a STRING
    CDBL converts to a DOUBLE

    I can email to you the EXE file and the full VB.NET code here if you want?

    If you are after more than this then email me at my university email account on>

    e5117204@tees.ac.uk



    Regards,

    DrM

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion