private void FillDgvFeeHistory(object dataSource) { var dgvHelper = new DgvHelper(dgvFeeHistory, dataSource); dgvHelper.Properties(borderStyle: BorderStyle.Fixed3D, font: "Arial", fontSize: 8) .Header(fontSize: 8, font: "Arial") .Add(0, "Index", "", width: 20, readOnly: true, visible: true) .Add(1, "Session", "Session", width: 80, readOnly: true, visible: true) .Add(2, "Term", "Term", width: 50, readOnly: true, visible: true) .Add(4, "OutstandingFee", "Outstanding Fee", width: 80, readOnly: true, visible: true, alignment: 'R') .Add(3, "PaidFee", "Fees Paid (Naira)", width: 80, readOnly: true, visible: true, alignment: 'R') .Add(5, "DatePaid", "Date Paid", width: 120, readOnly: true, visible: true) .Add(6, "FilePath", "FilePath", width: 120, readOnly: true); // Add "Pay Fee" button _llbPrintReceipt.Text = "Print Receipt"; _llbPrintReceipt.UseColumnTextForLinkValue = true; dgvFeeHistory.Columns.Insert(7, _llbPrintReceipt); dgvFeeHistory.AllowUserToResizeRows = false; }
private void FillStudentDgvPS(object dataSource) { var dgvHelper = new DgvHelper(dgvStudentsPS, dataSource); dgvHelper.Properties(borderStyle: BorderStyle.Fixed3D, font: "Arial", fontSize: 8) .Header(fontSize: 8, font: "Arial") .Add(0, "Index", "", width: 20, readOnly: true, visible: true) .Add(1, "FullName", "FullName", foreColor: Color.Red, width: 234, readOnly: true, visible: true) .Add(2, "PresentClass", "Class", width: 50, readOnly: true, visible: true) .Add(3, "OutstandingFee", "Debt(Naira)", visible: false, foreColor: Color.Red, width: 80, readOnly: true) .Add(5, "PaidFee", "PaidFee") .Add(6, "LastName", "LastName") .Add(7, "BirthDate", "BirthDate") .Add(8, "MiddleName", "MiddleName") .Add(9, "Active", "Active") .Add(10, "PresentArm", "PresentArm") .Add(11, "PresentTerm", "PresentTerm") .Add(12, "StartClass", "StartClass") .Add(13, "StartDate", "StartDate") .Add(14, "StartTerm", "StartTerm") .Add(15, "Id", "Id") .Add(15, "PresentClassEnum", "PresentClassEnum") .Add(15, "FirstName", "FirstName") .Add(15, "FeePayments", "FeePayments"); // Add "Repeating" button _btnRepeating.Text = "Repeating"; _btnRepeating.UseColumnTextForButtonValue = true; _btnRepeating.Width = 80; dgvStudentsPS.Columns.Insert(4, _btnRepeating); dgvStudentsPS.AllowUserToResizeRows = false; }
/// <summary> /// Fills the datagrid view /// </summary> /// <param name="dataSource">Data source for the datagridview</param> private void FillStudentDgvMS(object dataSource) { var dgvHelper = new DgvHelper(dgvViewStudent, dataSource); dgvHelper.Properties(borderStyle: BorderStyle.Fixed3D, font: "Arial", fontSize: 8) .Header(fontSize: 8, font: "Arial") .Add(0, "Index", "", width: 20, readOnly: true, visible: true) .Add(1, "FullName", "FullName", foreColor: Color.Red, width: 234, readOnly: true, visible: true) .Add(2, "PresentClass", "Class", width: 50, readOnly: true, visible: true) .Add(3, "OutstandingFee", "Debt(Naira)", foreColor: Color.Red, width: 80, readOnly: true, visible: true, alignment: 'R') .Add(9, "PaidFee", "PaidFee") .Add(10, "LastName", "LastName") .Add(11, "BirthDate", "BirthDate") .Add(12, "MiddleName", "MiddleName") .Add(13, "Active", "Active") .Add(14, "PresentArm", "PresentArm") .Add(15, "PresentTerm", "PresentTerm") .Add(15, "StartClass", "StartClass") .Add(15, "StartDate", "StartDate") .Add(15, "StartTerm", "StartTerm") .Add(15, "Id", "Id") .Add(15, "PresentClassEnum", "PresentClassEnum") .Add(15, "FirstName", "FirstName") .Add(15, "FeePayments", "FeePayments"); // Add "Pay Fee" button _btnPayFee.Text = "Pay Fee"; _btnPayFee.UseColumnTextForButtonValue = true; _btnPayFee.Width = 53; dgvViewStudent.Columns.Insert((int) ButtonColumnIndex.PayFee, _btnPayFee); // Add "View Student Info" button _btnViewInfo.Text = "View Info"; _btnViewInfo.UseColumnTextForButtonValue = true; _btnViewInfo.Width = 63; dgvViewStudent.Columns.Insert((int) ButtonColumnIndex.ViewInfo, _btnViewInfo); // Add "View Payment History" button _btnViewPaymentHistory.Text = "Fee History"; _btnViewPaymentHistory.UseColumnTextForButtonValue = true; _btnViewPaymentHistory.Width = 66; dgvViewStudent.Columns.Insert((int) ButtonColumnIndex.FeeHistory, _btnViewPaymentHistory); // Add "Deactivate Student" button _btnDeactivateStudent.Text = "Deactivate"; _btnDeactivateStudent.UseColumnTextForButtonValue = true; _btnDeactivateStudent.Width = 66; dgvViewStudent.Columns.Insert((int) ButtonColumnIndex.Deactivate, _btnDeactivateStudent); // Add "Change Fees" button _btnChangeSchoolFees.Text = "Change Fees"; _btnChangeSchoolFees.UseColumnTextForButtonValue = true; _btnChangeSchoolFees.Width = 80; dgvViewStudent.Columns.Insert((int)ButtonColumnIndex.ChangeFees, _btnChangeSchoolFees); dgvViewStudent.AllowUserToResizeRows = false; }