Exemple #1
0
 protected override void OnDataBindingComplete(DataGridViewBindingCompleteEventArgs e)
 {
     base.OnDataBindingComplete(e);
     SetupComponent();
     listRowBitmaps = new List<Bitmap>(new Bitmap[this.Rows.Count]);
     _DataBindingDate = DateTime.Now;
 }
Exemple #2
0
 private void DataGridViewHomeView_DataBindingComplete(object sender, System.Windows.Forms.DataGridViewBindingCompleteEventArgs e)
 {
     foreach (DataGridViewRow row in DataGridViewHomeView.Rows)
     {
         row.HeaderCell.Value = (row.Index + 1).ToString();
     }
 }
 void R_008_Employee_Current_On_Line_MasterDatabase_GridView_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     string plan_empl, tracking_empl;
     foreach (DataGridViewRow row in R_008_Employee_Current_On_Line_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Rows)
     {
         plan_empl = row.Cells["Plan_Empl_ID"].Value == null ? "" : row.Cells["Plan_Empl_ID"].Value.ToString().Trim();
         tracking_empl = row.Cells["Empl_ID"].Value == null ? "" : row.Cells["Empl_ID"].Value.ToString().Trim();
         if (plan_empl == "")
         {
             if (tracking_empl != "")
             {
                 row.DefaultCellStyle.BackColor = Color.Yellow;
             }
             else
             {
                 row.DefaultCellStyle.BackColor = Color.Orange;
             }
         }
         else
         {
             if (tracking_empl == "")
             {
                 row.DefaultCellStyle.BackColor = Color.Red;
             }
         }
     }
 }
        private void dgClassSchedule_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
        {
            for (int i = 0; i < dgClassSchedule.Rows.Count; i++)
            {
                var classNumber = i + 1;
                var weekDay = 0;
                foreach (DataGridViewComboBoxCell cell in dgClassSchedule.Rows[i].Cells.OfType<DataGridViewComboBoxCell>())
                {
                    weekDay++;
                    var filteredProfessors = _professorDatalayer.GetForScheduling((DayOfWeek)weekDay, classNumber, Convert.ToInt32(lstClassrooms.SelectedValue));

                    if (!filteredProfessors.Any(p => p.Id == 0))
                        filteredProfessors.Add(new Professor() { Id = 0, Name = "Vaga" });

                    var currentValue = Convert.ToInt32(cell.Value);
                    if (!filteredProfessors.Any(p => p.Id == currentValue))
                    {
                        var currentProfessor = _professorsList.Where(p => p.Id == currentValue).Single();
                        filteredProfessors.Add(currentProfessor);
                    }

                    cell.DataSource = filteredProfessors;
                    cell.DisplayMember = "Name";
                    cell.ValueType = typeof(int);
                    cell.ValueMember = "Id";
                }
            }
        }
 private void OnGridBindingComplete(object sender, System.Windows.Forms.DataGridViewBindingCompleteEventArgs e)
 {
     foreach (DataGridViewRow dgr in this.m_MultipliersDataGrid.Rows)
     {
         dgr.Cells[BROWSE_COLUMN_INDEX].Value = BROWSE_BUTTON_TEXT;
     }
 }
        void R_006_TrackingTT_PlanTL_Control_MasterDatabase_GridView_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
        {
            string plan_empl, his_empl_id;
            try
            {
                foreach (DataGridViewRow row in R_006_TrackingTT_PlanTL_MasterDatabase.MasterDatabase_GridviewTBL.GridView.Rows)
                {
                    // kiem tra plan và history giong nhau khong
                    plan_empl = row.Cells["Plan_Empl_ID"].Value == null ? "" : row.Cells["Plan_Empl_ID"].Value.ToString().Trim();
                    his_empl_id = row.Cells["His_Empl_ID"].Value == null ? "" : row.Cells["His_Empl_ID"].Value.ToString().Trim();
                    if (his_empl_id == "")
                    {
                        row.DefaultCellStyle.BackColor = Color.LightSeaGreen;
                    }
                    else if (plan_empl == "")
                    {
                        row.DefaultCellStyle.BackColor = Color.LightBlue;
                    }
                    else if (plan_empl != his_empl_id)
                    {
                        row.DefaultCellStyle.BackColor = Color.Red;
                    }
                }
            }
            catch
            {

            }
        }
Exemple #7
0
 private void grdBankalar_DataBindingComplete(object sender, System.Windows.Forms.DataGridViewBindingCompleteEventArgs e)
 {
     if (grdBankalar.Rows.Count > 0)
     {
         grdBankalar.Rows[0].Selected = false;
         for (int i = 0; i < grdBankalar.Rows.Count; i++)
         {
             try
             {
                 if (grdBankalar.Rows[i].Cells["grdBAKIYE_TIPI"].Value.ToString() == "1")
                 {
                     grdBankalar.Rows[i].Cells["grdBAKIYE"].Style.ForeColor = Color.Red;
                     grdBankalar.Rows[i].Cells["grdBAKIYE"].Style.Font      = new Font("Arial", 12, FontStyle.Bold);
                 }
                 else
                 {
                     grdBankalar.Rows[i].Cells["grdBAKIYE"].Style.ForeColor = Color.Green;
                     grdBankalar.Rows[i].Cells["grdBAKIYE"].Style.Font      = new Font("Arial", 12, FontStyle.Bold);
                 }
             }
             catch (Exception ex)
             {
             }
         }
     }
 }
 private void grdResultadoAvanco_DataBindingComplete(object sender, wf.DataGridViewBindingCompleteEventArgs e)
 {
     if (acaoFormAvanco == AcaoFormAvanco.Avanco)
     {
         for (int i = 0; i < grdResultadoAvanco.RowCount; i++)
         {
             string acao = grdResultadoAvanco.Rows[i].Cells["ACAO"].Value.ToString();
             if (acao == Funcoes.Properties.Settings.Default.avancado || acao == Funcoes.Properties.Settings.Default.avancadoSemCriterio)
             {
                 grdResultadoAvanco.Rows[i].DefaultCellStyle.ForeColor = Color.Green;
             }
             if (acao == Funcoes.Properties.Settings.Default.elementoTotalmenteAvancado)
             {
                 grdResultadoAvanco.Rows[i].DefaultCellStyle.ForeColor = Color.Blue;
             }
             if (acao == Funcoes.Properties.Settings.Default.percentualAvancadoMenor)
             {
                 grdResultadoAvanco.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
             }
             if (acao == Funcoes.Properties.Settings.Default.percentualIndicadoNaoFazParte)
             {
                 grdResultadoAvanco.Rows[i].DefaultCellStyle.ForeColor = Color.Yellow;
             }
         }
     }
 }
 private void MoonDataGridView_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     if (SortColumnIndex != null)
     {
         this.Sort(this.Columns[SortColumnIndex.Value], SortDerection);
     }
 }
Exemple #10
0
        private void TblUsuarios_DataBindingComplete(object sender, System.Windows.Forms.DataGridViewBindingCompleteEventArgs e)
        {
            int qtdColunas = this.tblUsuarios.Columns.Count;

            foreach (DataGridViewColumn coluna in this.tblUsuarios.Columns)
            {
                switch (coluna.Name)
                {
                case "Login":
                    coluna.HeaderText = "Login";
                    break;

                case "btnEditar":
                    coluna.DisplayIndex = qtdColunas - 2;
                    break;

                case "btnExcluir":
                    coluna.DisplayIndex = qtdColunas - 1;
                    break;

                default:
                    coluna.Visible = false;
                    break;
                }
                coluna.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            }
        }
        private void dataGridViewActiveListing_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
        {
            if (e.ListChangedType == ListChangedType.ItemChanged)
                return;

            for (int rowIdx = 0; rowIdx < this.dataGridViewActiveListing.Rows.Count; ++rowIdx)
            {
                DataGridViewCell listingTypeCell = this.dataGridViewActiveListing.Rows[rowIdx].Cells[ActiveListing_ListingTypeColIdx];
                if (listingTypeCell.Value == null)
                    continue;

                String listingType = listingTypeCell.Value.ToString();
                if (listingType != "Auction")
                    continue;

                DataGridViewCell bidCntCell = this.dataGridViewActiveListing.Rows[rowIdx].Cells[ActiveListing_BidCntColIdx];
                if (bidCntCell.Value == null)
                    continue;

                int bidCnt = 0;
                if (!Int32.TryParse(bidCntCell.Value.ToString(), out bidCnt))
                    continue;

                if (bidCnt > 0)
                    this.dataGridViewActiveListing.Rows[rowIdx].DefaultCellStyle.BackColor = ColorTranslator.FromHtml("#90EE90");
            }
        }
        private void _logDataGridView_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
        {
            foreach (DataGridViewRow row in _logDataGridView.Rows)
            {
                Icon icon = Properties.Resources.TransparentIcon;
                string toolTip = null;
                LogEntry logEntry = row.DataBoundItem as LogEntry;
                if (logEntry != null)
                {
                    toolTip = logEntry.LogSeverity.ToString();
                    switch (logEntry.LogSeverity)
                    {
                        case LogSeverity.Error:
                        case LogSeverity.Fatal:
                            icon = Resources.LogError;
                            break;

                        case LogSeverity.Warning:
                            icon = Resources.LogWarning;
                            break;

                        case LogSeverity.Information:
                            icon = Resources.LogInformation;
                            break;
                    }
                }
                row.Cells[0].Value = icon;
                row.Cells[0].ToolTipText = toolTip;
            }

        }
        private void TblProdutos_DataBindingComplete(object sender, System.Windows.Forms.DataGridViewBindingCompleteEventArgs e)
        {
            int qtdColunas = this.tblProdutos.Columns.Count;

            foreach (DataGridViewColumn coluna in this.tblProdutos.Columns)
            {
                switch (coluna.Name)
                {
                case "Descricao":
                    coluna.HeaderText = "Descrição";
                    break;

                case "CodigoBarras":
                    coluna.HeaderText = "Código de Barras";
                    break;

                case "Preco":
                    coluna.HeaderText = "Preço";
                    break;

                case "btnEditar":
                    coluna.DisplayIndex = qtdColunas - 2;
                    break;

                case "btnExcluir":
                    coluna.DisplayIndex = qtdColunas - 1;
                    break;

                default:
                    coluna.Visible = false;
                    break;
                }
                coluna.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            }
        }
Exemple #14
0
 protected override void OnDataBindingComplete(DataGridViewBindingCompleteEventArgs e)
 {
     base.OnDataBindingComplete(e);
     for (int i = 0; i < invisibleColumnRow.Count; i++)
     {
         this[invisibleColumnRow[i].X, invisibleColumnRow[i].Y].ReadOnly = true;
     }
 }
Exemple #15
0
 private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     foreach (DataGridViewColumn column in dataGridView1.Columns)
     {
         // ヘッダーをTweetVKeysの表記に差し替える
         column.HeaderText = Program.TweetVKeys[((DataTable)dataGridView1.DataSource).Columns[column.Index].Caption];
     }
 }
 private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     foreach (DataGridViewRow item in dataGridView1.Rows)
     {
         item.Cells["Candidate_birthday"].Value =DateTime.Now.Year - (item.DataBoundItem as humanresourcesDataSet.vw_resume_candidateRow).Candidate_birthday.Year;
         item.Cells["Candidate_sex"].Value = (item.DataBoundItem as humanresourcesDataSet.vw_resume_candidateRow).Candidate_sex == 1 ? "男" : "女";
     }
 }
Exemple #17
0
 private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     for (int i = 0; i < dataGridView1.Rows.Count; i++)
     {
         DataGridViewImageCell cell = (DataGridViewImageCell)dataGridView1.Rows[i].Cells[0];
         cell.Value = QYClient.Properties.Resources.ResourceManager.GetObject("icon" + dataGridView1.Rows[i].Cells["iconId"].Value.ToString());
         cell.OwningRow.Height = 120;
     }
 }
 private void DataGridViewX1DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     var gridView = (DataGridViewX)sender;
     if (null == gridView) return;
     foreach (DataGridViewRow r in gridView.Rows)
     {
         gridView.Rows[r.Index].HeaderCell.Value = (r.Index + 1).ToString();
     }
 }
Exemple #19
0
 private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     dataGridView1.RowHeadersWidth = 60;
     for (int i = 0; i < dataGridView1.Rows.Count; i++)
     {
         int j = i + 1;
         dataGridView1.Rows[i].HeaderCell.Value = j.ToString();
     }
 }
 private void DataGridViewGroups_DataBindingComplete(object sender, System.Windows.Forms.DataGridViewBindingCompleteEventArgs e)
 {
     foreach (DataGridViewRow oRow in DataGridViewGroups.Rows)
     {
         // With oRow.Cells("ColumnCreateAllInGroup")
         //     .Value = "create all in ->"
         // End With
     }
 }
Exemple #21
0
 private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     foreach (DataGridViewRow item in dataGridView1.Rows)
     {
         humanresourcesDataSet.vw_recommended_state_remarkRow i = (item.DataBoundItem as DataRowView).Row as humanresourcesDataSet.vw_recommended_state_remarkRow;
         item.Cells[0].Value = i.recommended_state_remark_Time.ToLongDateString() + "由" + i.User_realName + "更改状态为" + i.Recommended_State_Name;
         item.Cells[1].Value = i.recommended_state_remark_content;
     }
 }
Exemple #22
0
 private void grdList_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     if (null != grdList)
     {
         foreach (DataGridViewRow r in grdList.Rows)
         {
             grdList.Rows[r.Index].HeaderCell.Value = (r.Index + 1).ToString();
         }
     }
 }
        void ProjectsDataGridView_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
        {
            ProjectsDataGridView.Columns[0].Width = 20;

            foreach (DataGridViewRow row in ProjectsDataGridView.Rows)
            {
                row.Cells[0].Value = true;

            }
        }
 private void dataGridViewReceptions_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e) {
   foreach(DataGridViewRow row in dataGridViewReceptions.Rows) {
     Reception rec = (Reception)row.DataBoundItem;
     if(rec.IsValid) {
       row.DefaultCellStyle.Font = new Font(dataGridViewReceptions.Font, FontStyle.Bold);
     } else {
       row.DefaultCellStyle.ForeColor = Color.Red;
     }
   }
 }
 private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     DataGridViewTextBoxColumn dgv_Text = new DataGridViewTextBoxColumn();
     for (int i = 0; i < dataGridView1.Rows.Count; i++)
     {
         //�к�
         int j = i + 1;
         dataGridView1.Rows[i].HeaderCell.Value = j.ToString();
     }
 }
Exemple #26
0
 private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
     {
         DataGridViewRow row = this.dataGridView1.Rows[i];
         if ((i % 2) != 0)
         {
             row.DefaultCellStyle.BackColor = Color.Gainsboro;
         }
     }
 }
Exemple #27
0
 private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     if (this.dataGridView1.Rows.Count != 0)
     {
         for (int i = 0; i < this.dataGridView1.Rows.Count;)
         {
             this.dataGridView1.Rows[i].DefaultCellStyle.BackColor = System.Drawing.Color.Pink;
             i = i + 2;
         }
     }
 }
Exemple #28
0
        /// <summary>
        /// Paints Personal and Premium rows with Coral color.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GridView_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
        {
            foreach (DataGridViewRow vr in GridView.Rows) {
                CountryRow r = (CountryRow) ((DataRowView)vr.DataBoundItem).Row;

                if(!r.IsIsOutOfPlayNull()) {
                    for (int i = 1, j = GridView.Columns.Count; i < j; i++){
                        vr.Cells[i].Style.BackColor = Color.LightCoral;
                    }
                }
            }
        }
 private void dataSourcesGrid_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     int i = 0;
     foreach (var entry in sourceDS)
     {
         if (destDS.ContainsKey(entry.Key))
         {
             dataSourcesGrid["Destination", i].Value = destDS[entry.Key];
         }
         i++;
     }
 }
Exemple #30
0
 private void dgvSales_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     var gridView = (DataGridView)sender;
     foreach (DataGridViewRow row in gridView.Rows)
     {
         SaleItem saleItem = (SaleItem)row.DataBoundItem;
         var product = saleItem.Product;
         row.Cells[ProductNameColumn.Index].Value = product.Name;
         row.Cells[PriceColumn.Index].Value = product.Price;
         row.Cells[DateColumn.Index].Value = saleItem.Sale.SaleTimeStamp;
     }
 }
        private void dataGridViewPostSale_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
        {
            if (e.ListChangedType == ListChangedType.ItemChanged)
                return;

            for (int rowIdx = 0; rowIdx < this.dataGridViewPostSale.Rows.Count; rowIdx++)
            {
                DataGridViewCell orderLineItemIdCell = this.dataGridViewPostSale.Rows[rowIdx].Cells[PostSaleDgv_OrderLineItemIdIdx];
                if (orderLineItemIdCell.Value == null)
                    continue;

                String orderLineItemId = orderLineItemIdCell.Value.ToString();
                DataRow dr = getPostSaleOrderLocally(orderLineItemId);
                if (dr == null)
                    continue;

                int transId = StringUtil.GetSafeInt(dr["TransactionId"]);
                String buyerId = StringUtil.GetSafeString(dr["BuyerId"]);
                String sellerName = StringUtil.GetSafeString(dr["SellerName"]);
                String itemId = StringUtil.GetSafeString(dr["ItemId"]);

                if (buyerId == "" || sellerName == "" || itemId == "")
                    continue;

                TransactionMessageStatus messageStatus = (TransactionMessageStatus)StringUtil.GetSafeInt(dr["MessageStatus"]);

                if (messageStatus == TransactionMessageStatus.BuyerRepliedSellerNotReplied)
                {
                    TransactionMessageStatus messageStatusComputed
                        = EbayMessageDAL.GetTransactionMessageStatus(buyerId, sellerName, itemId);

                    if (messageStatus != messageStatusComputed)
                    {
                        EbayTransactionDAL.UpdateTransactionMessageStatus(transId, messageStatusComputed);
                        messageStatus = messageStatusComputed;
                    }
                }

                Color rowBkColor = Color.White;
                if (messageStatus == TransactionMessageStatus.SellerInquired)
                    rowBkColor = ColorTranslator.FromHtml("#90EE90");
                else if (messageStatus == TransactionMessageStatus.BuyerRepliedSellerNotReplied)
                    rowBkColor = ColorTranslator.FromHtml("#FFFF00");
                else if (messageStatus == TransactionMessageStatus.BuyerRepliedSellerReplied)
                    rowBkColor = ColorTranslator.FromHtml("#DAA520");

                if (!StringUtil.GetSafeBool(dr["IsPaid"]))
                    rowBkColor = ColorTranslator.FromHtml("#808080");

                this.dataGridViewPostSale.Rows[rowIdx].DefaultCellStyle.BackColor = rowBkColor;
            }
        }
 private void dgvUsers_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     var gridView = (DataGridView)sender;
     foreach (DataGridViewRow row in gridView.Rows)
     {
         if (!row.IsNewRow)
         {
             var user = (User)row.DataBoundItem;
             var role = user.Role;
             row.Cells[roleName.Index].Value = role.Name;
         }
     }
 }
Exemple #33
0
 void dgv_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     foreach (DataGridViewRow r in dgv.Rows)
     {
         if (r.Cells[2].Value != null && System.Uri.IsWellFormedUriString(r.Cells[2].Value.ToString(), UriKind.Absolute))
         {
             r.Cells[2] = new DataGridViewLinkCell();
             // Note that if I want a different link colour for example it must go here
             DataGridViewLinkCell c = r.Cells[2] as DataGridViewLinkCell;
             c.LinkColor = Color.Blue;
         }
     }
 }
Exemple #34
0
        /// <summary>
        /// Datas the grid view x1 data binding complete.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.DataGridViewBindingCompleteEventArgs"/> instance containing the event data.</param>
        private void DataGridViewX1DataBindingComplete(object sender, System.Windows.Forms.DataGridViewBindingCompleteEventArgs e)
        {
            var gridView = (DataGridViewX)sender;

            if (null == gridView)
            {
                return;
            }
            foreach (DataGridViewRow r in gridView.Rows)
            {
                gridView.Rows[r.Index].HeaderCell.Value = (r.Index + 1).ToString();
            }
        }
        private void dgvShifts_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
        {
            /* Set-up column width that make sense */
            dgvShifts.Columns[0].Width = 35;
            dgvShifts.Columns[1].Width = 65;
            dgvShifts.Columns[2].Width = 120;
            dgvShifts.Columns[3].Width = 120;

            /* Set-up human readable column names */
            dgvShifts.Columns[1].HeaderText = "Car #";
            dgvShifts.Columns[2].HeaderText = "Start";
            dgvShifts.Columns[3].HeaderText = "End";
        }
Exemple #36
0
 private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     //foreach (DataGridViewRow row in dataGridView1.Rows)
     //{
     //    DateTime StartTime = (DateTime)row.Cells["StartTime"].Value;
     //    row.Cells["StartTime"].ValueType = typeof(string);
     //    row.Cells["StartTime"].Value = StartTime.ToShortTimeString();
     //    DateTime EndTime = (DateTime)row.Cells["EndTime"].Value;
     //    row.Cells["EndTime"].ValueType = typeof(string);
     //    row.Cells["EndTime"].Value = EndTime.ToShortTimeString();
     //}
     //dataGridView1.Columns["StartTime"].ValueType = typeof(string);
     //dataGridView1.Columns["EndTime"].ValueType = typeof(string);
 }
 private void dgPaymentToSupplier_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     if (cbPaid.Checked)
     {
         dgPaymentFromCustomer.Columns["Receive Payment"].Visible = false;
     }
     else
     {
         dgPaymentFromCustomer.Columns["Receive Payment"].Visible = true;
         dgPaymentFromCustomer.Columns["PaidDate"].Visible = false;
         dgPaymentFromCustomer.Columns["Receive Payment"].DefaultCellStyle.ForeColor = System.Drawing.Color.Blue;
         dgPaymentFromCustomer.Columns["Receive Payment"].DefaultCellStyle.BackColor = System.Drawing.Color.AliceBlue;
         dgPaymentFromCustomer.Columns["Receive Payment"].DefaultCellStyle.SelectionForeColor = System.Drawing.Color.Navy;
     }
 }
Exemple #38
0
 private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
 {
     String filterStatus = DataGridViewAutoFilterColumnHeaderCell.GetFilterStatus(dataGridView1);
     if (String.IsNullOrEmpty(filterStatus))
     {
         showAllLabel.Visible = false;
         filterStatusLabel.Visible = false;
     }
     else
     {
         showAllLabel.Visible = true;
         filterStatusLabel.Visible = true;
         filterStatusLabel.Text = filterStatus;
     }
 }
        private void TblClientes_DataBindingComplete(object sender, System.Windows.Forms.DataGridViewBindingCompleteEventArgs e)
        {
            int qtdColunas = this.tblClientes.Columns.Count;

            foreach (DataGridViewColumn coluna in this.tblClientes.Columns)
            {
                switch (coluna.Name)
                {
                case "Cpf":
                    coluna.HeaderText = "CPF";
                    break;

                case "DataNascimento":
                    coluna.HeaderText = "Data Nascimento";
                    break;

                case "Email":
                    coluna.HeaderText = "E-mail";
                    break;

                case "Observacao":
                    coluna.HeaderText = "Observação";
                    break;

                case "Nome":
                case "Sexo":
                case "Telefone":
                    break;

                case "btnEditar":
                    coluna.DisplayIndex = qtdColunas - 2;
                    break;

                case "btnExcluir":
                    coluna.DisplayIndex = qtdColunas - 1;
                    break;

                default:
                    coluna.Visible = false;
                    break;
                }
                coluna.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            }
        }
Exemple #40
0
        private void dgvArticulos_DataBindingComplete(object sender, System.Windows.Forms.DataGridViewBindingCompleteEventArgs e)
        {
            foreach (DataGridViewColumn item in dgvArticulos.Columns)
            {
                item.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            }

            dgvArticulos.Columns[0].HeaderText = "Id";
            dgvArticulos.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvArticulos.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader; //autoajusta

            dgvArticulos.Columns[1].HeaderText = "Cód. Barra";
            dgvArticulos.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
            dgvArticulos.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;

            dgvArticulos.Columns[2].HeaderText = "Descripción";
            dgvArticulos.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
            dgvArticulos.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;

            dgvArticulos.Columns[3].HeaderText = "Costo";
            dgvArticulos.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            dgvArticulos.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader; //autoajusta

            dgvArticulos.Columns[4].HeaderText = "Precio L1";
            dgvArticulos.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            dgvArticulos.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader; //autoajusta

            dgvArticulos.Columns[5].HeaderText = "Precio L2";
            dgvArticulos.Columns[5].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            dgvArticulos.Columns[5].AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader; //autoajusta

            dgvArticulos.Columns[6].HeaderText = "Precio L3";
            dgvArticulos.Columns[6].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            dgvArticulos.Columns[6].AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader; //autoajusta

            dgvArticulos.Columns[7].Visible = false;

            dgvArticulos.Columns[8].HeaderText = "Observación";
            dgvArticulos.Columns[8].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
            dgvArticulos.Columns[8].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
        }
Exemple #41
0
        private void dgvDatos_DataBindingComplete(object sender, System.Windows.Forms.DataGridViewBindingCompleteEventArgs e)
        {
            foreach (DataGridViewColumn c in dgvDatos.Columns)
            {
                c.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            }

            dgvDatos.Columns[0].HeaderText = "Compra";
            dgvDatos.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvDatos.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader;

            dgvDatos.Columns[1].HeaderText = "Fecha";
            dgvDatos.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvDatos.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader;

            dgvDatos.Columns[2].HeaderText = "Proveedor";
            dgvDatos.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvDatos.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;

            dgvDatos.Columns[3].HeaderText = "Usuario";
            dgvDatos.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvDatos.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
        }
 private void FeatureDataGridView_DataBindingComplete(object sender, System.Windows.Forms.DataGridViewBindingCompleteEventArgs e)
 {
     FeatureDataGridView.ClearSelection();
 }
 private void this_DataBindingComplete(System.Object sender, System.Windows.Forms.DataGridViewBindingCompleteEventArgs e)
 {
     this.ClearSelection();
 }