Пример #1
0
        private void MiscTemplatesGridView_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
        {
            try
            {
                F11018MiscReceiptData.ListMiscReceiptTemplateDataTable miscReceiptTemplateDataTable = new F11018MiscReceiptData.ListMiscReceiptTemplateDataTable();
                UltraGridBand currentBand = this.MiscTemplatesGridView.DisplayLayout.Bands[0];
                currentBand.Columns[miscReceiptTemplateDataTable.MiscTemplateIDColumn.ColumnName].Header.VisiblePosition = 0;
                currentBand.Columns[miscReceiptTemplateDataTable.TemplateNameColumn.ColumnName].Header.VisiblePosition   = 1;
                currentBand.Columns[miscReceiptTemplateDataTable.UserIDColumn.ColumnName].Header.VisiblePosition         = 2;
                currentBand.Columns[miscReceiptTemplateDataTable.UserNameColumn.ColumnName].Header.VisiblePosition       = 3;
                currentBand.Columns[miscReceiptTemplateDataTable.ReceivedFromColumn.ColumnName].Header.VisiblePosition   = 4;
                currentBand.Columns[miscReceiptTemplateDataTable.AmountColumn.ColumnName].Header.VisiblePosition         = 5;
                currentBand.Columns[miscReceiptTemplateDataTable.CodeColumn.ColumnName].Header.VisiblePosition           = 6;

                currentBand.Columns[miscReceiptTemplateDataTable.MiscTemplateIDColumn.ColumnName].Hidden = true;
                currentBand.Columns[miscReceiptTemplateDataTable.TemplateNameColumn.ColumnName].Hidden   = false;
                currentBand.Columns[miscReceiptTemplateDataTable.UserIDColumn.ColumnName].Hidden         = true;
                currentBand.Columns[miscReceiptTemplateDataTable.UserNameColumn.ColumnName].Hidden       = true;
                currentBand.Columns[miscReceiptTemplateDataTable.ReceivedFromColumn.ColumnName].Hidden   = false;
                currentBand.Columns[miscReceiptTemplateDataTable.AmountColumn.ColumnName].Hidden         = false;
                currentBand.Columns[miscReceiptTemplateDataTable.AmountColumn.ColumnName].Format         = "#,##0.00";
                currentBand.Columns[miscReceiptTemplateDataTable.CodeColumn.ColumnName].Hidden           = true;
                this.MiscTemplatesGridView.DisplayLayout.Override.AllowColSizing = AllowColSizing.None;
            }
            catch (Exception ex)
            {
            }
        }
Пример #2
0
        /// <summary>
        /// Populates the misc template grid.
        /// </summary>
        private void PopulateMiscTemplateGrid()
        {
            F11018MiscReceiptData.ListMiscReceiptTemplateDataTable miscReceiptTemplateDataTable = new F11018MiscReceiptData.ListMiscReceiptTemplateDataTable();
            miscReceiptTemplateDataTable.Clear();
            miscReceiptTemplateDataTable.Merge(this.form1022Control.WorkItem.F1022_ListMiscReceiptTemplate().ListMiscReceiptTemplate);
            ////load grid
            this.MiscTemplatesGridView.DataSource = miscReceiptTemplateDataTable;

            int rowIndex = this.MiscTemplatesGridView.Rows.Count;

            if (rowIndex > 0)
            {
                this.MiscTemplatesGridView.Enabled    = true;
                this.AcceptMiscTemplateButton.Enabled = true;
                // Modified to implement TFS#21152 Item
                // this.DeleteButton.Enabled = this.DeleteButton.ActualPermission;
                rowIndex = 0;
                if (this.MiscTemplatesGridView.ActiveRow == null)
                {
                    ////select first row
                    this.MiscTemplatesGridView.ActiveCell = this.MiscTemplatesGridView.Rows[rowIndex].Cells[miscReceiptTemplateDataTable.TemplateNameColumn.ColumnName];
                }
                ////select current cell
                this.MiscTemplatesGridView.ActiveCell.Activate();
                this.MiscTemplatesGridView.ActiveRow.Selected = true;
            }
            else
            {
                this.MiscTemplatesGridView.ActiveCell = null;
                this.MiscTemplatesGridView.Enabled    = false;
                this.AcceptMiscTemplateButton.Enabled = false;
                // Modified to implement TFS#21152 Item
                //this.DeleteButton.Enabled = false;
            }
        }