/// <summary> /// Handles the Load event of the F1021 control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> private void F1024_Load(object sender, EventArgs e) { ////set default value on form load // this.DistrictTextBox.Text = this.miscReceiptFields.DefaultComment; this.flagloadProcess = false; this.LoadLeviesCombo(); this.AmountTextBox.Text = string.Empty; this.AmountTextBox.Focus(); this.NewSubFundList = new DistrictSelectionData.ListSubFundItemsDataTable(); this.DistrictListDataGridView.AutoGenerateColumns = false; this.DistrictListDataGridView.DataSource = null; this.DistrictListDataGridView.Enabled = false; this.DistrictListDataGridView.Rows[0].Selected = false; this.CustomizeDataGrid(); this.flagloadProcess = true; }
/// <summary> /// Loading sub grid /// </summary> /// <param name="DistrictID">pass distinct id</param> private void LoadSubGrid(string DistrictID) { try { this.NewSubFundList = this.form1024Control.WorkItem.f1024_pclst_SubFunds(Convert.ToInt32(districtId)).ListSubFundItems; if (this.NewSubFundList.Rows.Count > 0) { foreach (DataRow dr in this.NewSubFundList.Rows) { if (this.LevisComboBox.SelectedValue.ToString() == "1") { dr[this.NewSubFundList.CheckedColumn.ColumnName] = true; } else if (this.LevisComboBox.SelectedValue.ToString() == "2" && Convert.ToBoolean(dr["IsVoterApproved"]) == false) { dr[this.NewSubFundList.CheckedColumn.ColumnName] = true; } else if (this.LevisComboBox.SelectedValue.ToString() == "3" && Convert.ToBoolean(dr["IsVoterApproved"]) == true) { dr[this.NewSubFundList.CheckedColumn.ColumnName] = true; } } } this.DistrictListDataGridView.DataSource = this.NewSubFundList.DefaultView; if (this.DistrictListDataGridView.Rows.Count > 0) { this.DistrictListDataGridView.Enabled = true; this.MiscTemplateVscrollBar.Visible = false; this.DistrictListDataGridView.Width = 456; } } catch (Exception e1) { ExceptionManager.ManageException(e1, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm); } finally { this.Cursor = Cursors.Default; } }