Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.68 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace Multi_Demo
  12. {
  13.     public partial class detailedForm : Form
  14.     {
  15.         public detailedForm()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void dataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e)
  21.         {
  22.             InvoiceInfo.theInvoice = mainForm.theInvoice[dataGrid.SelectedCells[0].RowIndex];
  23.         }
  24.  
  25.         private void detailedForm_Shown(object sender, EventArgs e)
  26.         {
  27.             dataGrid.ColumnCount = 5;
  28.             dataGrid.Columns[0].Name = "Invoice Number";
  29.             dataGrid.Columns[1].Name = "Invoice Date";
  30.             dataGrid.Columns[2].Name = "Customer Number";
  31.             dataGrid.Columns[3].Name = "Invoice Amount";
  32.             dataGrid.Columns[4].Name = "Aging";
  33.  
  34.             for (int currentIndex = 0; currentIndex < mainForm.arraySize; currentIndex++)
  35.             {
  36.                 String[] aRow = new String[]{mainForm.theInvoice[currentIndex].number.ToString(),
  37.                                              mainForm.theInvoice[currentIndex].date.ToString(),
  38.                                              mainForm.theInvoice[currentIndex].customerNumber.ToString(),
  39.                                              mainForm.theInvoice[currentIndex].invoiceAmount.ToString("c"), "NET/"+
  40.                                              mainForm.theInvoice[currentIndex].Aging.ToString()};
  41.  
  42.                 dataGrid.Rows.Add(aRow);
  43.             }
  44.  
  45.         }
  46.  
  47.  
  48.     }
  49.  
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement