Employers - Post Free Jobs
Forum guidelines
AuthorQuestion
how to populate datagridview using textbox's data
Posted on: 29 Sep 2012

Say, I need to calculate number of credit card payments, enter data in

1)   Textbox1, enter total credit card balance     
2) Textbox2, enter interest rate
3) Textbox3, enter number of payments

Click a Button to calculate and list number of payments, remaining balance, and
interest accrued display results in the datagridview.

Thanks




AuthorReply
Shivanand Arur
  • 0
  • 0
accepted
Re: how to populate datagridview using textbox's data
Posted on: 29 Sep 2012   Accepted Answer
Hey you can do one thing... Once you accept the values from the textboxes... you do your calculation and add the information in a Collection Object like an "Arraylist" or a Dictionary Object if you have any key-value information.... and after adding the content in any of the Collection Object, just bind the Grid with the Collection object in the event which you prefer (say - Button Click Event).

Hope this suggestion helps you.... If you have any doubt, the please feel free to ask...

Thank you.

Keep Sharing **** Keep Caring PLEASE MARK MY ANSWER AS ACCEPTED IF IT HELPED YOU!!!
meng
  • 0
  • 0
Re: how to populate datagridview using textbox's data
Posted on: 03 Oct 2012  
thanks for your suggestion, i got it working!
Re: how to populate datagridview using textbox's data
Posted on: 03 Oct 2012  
Hi Meng,

Can you please share your code.




Thanks

If this post helps you mark it as answer
Thanks

meng
  • 0
  • 0
Re: how to populate datagridview using textbox's data
Posted on: 03 Oct 2012  
here's part of the code to load textbox data into datagridview.
//enter for loop
for (int i = 1; i <= ccB;i++)
{
...
string[] row2 = new string[] { i.ToString(), string.Format("{0:C2}", ccB).ToString(), string.Format("{0:C2}",payA).ToString(), string.Format("{0:C2}", iAcc).ToString() };
// fill gridview with CC data
dataGridView1.Rows.Add(row2);
.....
}
}


Re: how to populate datagridview using textbox's data
Posted on: 05 Oct 2012  
Thanks
If this post helps you mark it as answer
Thanks

Re: how to populate datagridview using textbox's data
Posted on: 11 Oct 2012  
Hey Meng, CAN YOU PLEASE MARK MY ANSWER AS ACCEPTED IF IT HELPED.... I KNOW ITS TOO LATE TO REMIND YOU BUT CAN YOU PLEASE MARK IT AS ACCEPTED... 

Thank You!!!

Keep Sharing **** Keep Caring PLEASE MARK MY ANSWER AS ACCEPTED IF IT HELPED YOU!!!

SPONSORED BY

Offshore Software and Database Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.