i want to use DataGridView to display the result from 3 textBoxes ?

is it possible to do that ?

Please help

7 Years
Discussion Span
Last Post by __avd

thanks mate,

I should've posted my code first time, sorry about that.

Oky, again me problem is i want to illustrate the result of calculating the amount of payment and the principle and the loan period which i put each of them in a textbox and i want to illustrate the result in DataGridview, and also i want the DataGridview illustrates the result according to the loan period.

and this was my code which it just illustrate the first payment !
Code *****************

Public Class Form1
    Dim p, rn, amount, n, s, peroid, intrest, pamount, count, t, aaa,pamentamount,principleamount,intrestamount ,outstandingbalance As Integer
    'Dim u As Int16
    'Friend WithEvents u As System.Windows.Forms.NumericUpDown

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim z As Integer
        For z = 0 To NumericUpDown2.Value - 1

            DataGridView1.Item(0, 0).Value = z

            pamentamount = ((NumericUpDown1.Value * TextBox1.Text) / (1 - (1 + NumericUpDown1.Value) ^ -NumericUpDown2.Value))
            DataGridView1.Item(1, 0).Value = pamentamount

            principleamount = amount * (1 + NumericUpDown1.Value) ^ -(1 + NumericUpDown2.Value - z)
            DataGridView1.Item(2, 0).Value = principleamount

            intrestamount= pamentamount-principleamount
            DataGridView1.Item(3, 0).Value = principleamount

            outstandingbalance = (intrestamount/NumericUpDown1.Value)-principleamount
            DataGridView1.Item(4, 0).Value = principleamount
        Next z

  End Sub

Edited by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).


>and this was my code which it just illustrate the first payment !

What did you expect it to do? Do you get any errors?

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.