Пример #1
0
 private void dgvInvoices_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
 {
     if (dgvInvoices.SelectedRows.Count > 0)
     {
         if (dgvInvoices.SelectedRows[0].Cells[0].Value != null)
         {
             m_selectedID = (int)dgvInvoices.SelectedRows[0].Cells[0].Value;
         }
     }
 }
 private void SeleccionCuenta(object sender, DataGridViewRowStateChangedEventArgs e)
 {
     if (dgvCuentas.SelectedRows.Count > 0)
     {
         grpDeposito.Enabled = true;
     }
     if (dgvCuentas.SelectedRows.Count == 0)
     {
         grpDeposito.Enabled = false;
     }
 }
 private void SeleccionCliente(object sender, DataGridViewRowStateChangedEventArgs e)
 {
     if (dgvClientes.SelectedRows.Count > 0)
     {
         grpAltaCuenta.Enabled = true;
     }
     if (dgvClientes.SelectedRows.Count == 0)
     {
         grpAltaCuenta.Enabled = false;
     }
 }
Пример #4
0
 private void dgvPatients_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
 {
     if (dgvPatients.SelectedRows.Count == 1 && dgvPatients.SelectedRows[0].Cells[0].Value != null)
     {
         tsbDelete.Enabled = true;
         m_nSelectedID = (int)dgvPatients.SelectedRows[0].Cells[0].Value;
     }
     else
     {
         tsbDelete.Enabled = false;
     }
 }
Пример #5
0
        private void dgvDatos_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
        {
            if (!e.Row.Selected) return;

            // Se mandan llenar los datos de la ventana de cobro.
            this.VentaID = Util.Entero(e.Row.Cells["colVentaID"].Value);
            this.VentaPagoID = Util.Entero(e.Row.Cells["colVentaPagoID"].Value);
            this.ctlCobro.LlenarDatosGenerales(this.VentaID);
            this.ctlCobro.LlenarDatosFormasDePago(this.VentaPagoID);

            // Se verifica si es factura, en cuyo caso, se deshabilitan las formas de pago
            this.ctlCobro.HabilitarFormasDePago = (!Util.Logico(e.Row.Cells["EsFactura"].Value));
        }
 private void SeleccionCuenta(object sender, DataGridViewRowStateChangedEventArgs e)
 {
     if (dgvCuentas.SelectedRows.Count > 0)
     {
         btnModificarCuenta.Enabled = true;
         btnDarBajaCuenta.Enabled = true;
     }
     if (dgvCuentas.SelectedRows.Count == 0)
     {
         btnModificarCuenta.Enabled = false;
         btnDarBajaCuenta.Enabled = false;
     }
 }
Пример #7
0
 private void dataGridView1_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
 {
     if (dataGridView1.SelectedRows.Count > 0)
     {
         if (dataGridView1.SelectedRows.Count == 1)
             EditButton.Enabled = true;
         else
             EditButton.Enabled = false;
         PauseButton.Enabled = ResetButton.Enabled = DeleteButton.Enabled = false;
         StopButton.Enabled = true;
         int state = 0;
         for (int i = 0; i < dataGridView1.SelectedRows.Count; i++)
         {
             int j = 0;
             if (int.TryParse(dataGridView1.SelectedRows[i].Cells[0].Value.ToString(), out j))
             {
                 switch (state)
                 {
                     case 0:
                         if (arr[j-1].getStatus() == "Running")
                             state = 1;
                         else
                             state = 2;
                         break;
                     case 1:
                         if (arr[j-1].getStatus() != "Running")
                             state = 3;
                         break;
                     case 2:
                         if (arr[j-1].getStatus() == "Running")
                             state = 3;
                         break;
                     case 3:
                     default:
                         break;
                 }
             }
         }
         if (state == 2)
             StopButton.Text = "Start Task";
         else
             StopButton.Text = "Stop Task";
     }
     else
     {
         EditButton.Enabled = PauseButton.Enabled = ResetButton.Enabled = StopButton.Enabled = DeleteButton.Enabled = false;
     }
 }
Пример #8
0
        private void dataGridViewProject_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
        {
            try
            {
                if (e.StateChanged == DataGridViewElementStates.Selected)
                {
                    if (dataGridViewProject.Rows.Count > 0)
                    {
                        dataRowProject = dataTableProject.Rows[e.Row.Index];
                        string projectName = Convert.ToString(dataRowProject["ProjectName"]);

                        ServiceClient client = new ServiceClient();
                        dataTableDevice = client.SelectDeviceByProject(projectName);
                        dataGridViewProjectDevice.DataSource = dataTableDevice;
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionLog.Instance.WriteLog(ex, LogType.UI);
                ZBMMessageBox.ShowError(ex);
            }
        }
Пример #9
0
        private void dataGridViewProjectDevice_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
        {
            try
            {
                if (e.StateChanged == DataGridViewElementStates.Selected)
                {
                    if (dataTableDevice.Rows.Count > 0)
                    {
                        dataRowDevice = dataTableDevice.Rows[e.Row.Index];
                        int projectDeviceID = Convert.ToInt32(dataRowDevice["ID"]);
                        ServiceClient client=new ServiceClient();
                        dataTableChannelSensor = client.SelectChannelSensorByProjectDevice(projectDeviceID);
                        dataGridViewChannelSensor.DataSource = dataTableChannelSensor;
                    }
                }

            }
            catch (Exception ex)
            {
                ExceptionLog.Instance.WriteLog(ex, LogType.UI);
                ZBMMessageBox.ShowError(ex);
            }
        }
Пример #10
0
 private void dataGridViewProjectUnit_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
 {
     try
     {
         if (e.StateChanged == DataGridViewElementStates.Selected)
         {
             dataGridViewProjectSensor.DataSource = null;
             if (dataTableProjectUnit.Rows.Count > 0)
             {
                 dataRowProjectUnit = dataTableProjectUnit.Rows[e.Row.Index];
                 //断面是直接和项目绑定的
                 int projectUnitID = Convert.ToInt32(dataRowProjectUnit["断面编号"]);
                 ServiceClient client = new ServiceClient();
                 dataTableProjectSensor = client.SelectProjectSensorByProjectUnit(projectUnitID);
                 dataGridViewProjectSensor.DataSource = dataTableProjectSensor;
             }
         }
     }
     catch (Exception ex)
     {
         ExceptionLog.Instance.WriteLog(ex, LogType.UI);
         ZBMMessageBox.ShowError(ex);
     }
 }
Пример #11
0
 private void dgvDetalle_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
 {
     if (!e.Row.Selected) return;
     foreach (DataGridViewCell Celda in e.Row.Cells)
         Celda.Style.SelectionForeColor = Celda.InheritedStyle.ForeColor;
 }
Пример #12
0
        private void dgvItems_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
        {

        }
Пример #13
0
        private void OnChangeRole(object sender, DataGridViewRowStateChangedEventArgs e)
        {
            Logger.Enter();
            do
            {
                if (e.StateChanged != DataGridViewElementStates.Selected)
                    break;

                if (e.Row.IsNewRow)
                {
                    privilegesGrid.Rows.Clear();
                    break;
                }
                dbDataSet.userPrivilegesRow row = (dbDataSet.userPrivilegesRow)((DataRowView)e.Row.DataBoundItem).Row;
                FillPrivileges(row);
            } while (false);
            Logger.Leave();
        }
        /// <include file='doc\DataGridView.uex' path='docs/doc[@for="DataGridView.OnRowStateChanged"]/*' />
        protected virtual void OnRowStateChanged(int rowIndex, DataGridViewRowStateChangedEventArgs e)
        {
            Debug.Assert(rowIndex >= -1);

            // If row.Frozen changed, we need to update the vertical scroll bar
            // A hidden row may become visible and vice-versa, we'd better repaint the whole control
            DataGridViewRow dataGridViewRow = e.Row;
            DataGridViewElementStates newState = DataGridViewElementStates.None;
            bool rowVisible = false;
            if (rowIndex >= 0)
            {
                newState = this.Rows.GetRowState(rowIndex);
                rowVisible = ((newState & DataGridViewElementStates.Visible) != 0);
            }
            switch (e.StateChanged)
            {
                // At this point we assume that only the Selected state has an influence on the rendering of the row.
                // If there is a customer scenario where another state has an influence, the dev will have to invalidate the row by hand.
                // case DataGridViewElementStates.ReadOnly:
                // case DataGridViewElementStates.Resizable:

                case DataGridViewElementStates.Selected:
                    if (rowVisible && this.inBulkPaintCount == 0)
                    {
                        InvalidateRowPrivate(rowIndex);
                    }
                    break;

                case DataGridViewElementStates.Frozen:
                    if (rowVisible)
                    {
                        if ((newState & DataGridViewElementStates.Frozen) == 0)
                        {
                            // row was unfrozen - make it the first visible scrolling row if there is room
                            FirstVisibleScrollingRowTempted(rowIndex);
                        }
                        PerformLayoutPrivate(false /*useRowShortcut*/, false /*computeVisibleRows*/, true /*invalidInAdjustFillingColumns*/, true /*repositionEditingControl*/);
                        Invalidate();
                    }
                    break;

                case DataGridViewElementStates.Visible:
                {
                    if (!rowVisible && (newState & DataGridViewElementStates.Displayed) != 0)
                    {
                        // Displayed row becomes invisible. Turns off the Displayed state.
                        this.Rows.SetRowState(rowIndex, DataGridViewElementStates.Displayed, false);
                    }

                    PerformLayoutPrivate(false /*useRowShortcut*/, false /*computeVisibleRows*/, true /*invalidInAdjustFillingColumns*/, true /*repositionEditingControl*/);
                    Invalidate();

                    bool rowDisplayed = (this.Rows.GetRowState(rowIndex) & DataGridViewElementStates.Displayed) != 0;
                    DataGridViewAutoSizeRowsModeInternal autoSizeRowsModeInternal = (DataGridViewAutoSizeRowsModeInternal)this.autoSizeRowsMode;

                    bool autoSizeRow = false;

                    if (autoSizeRowsModeInternal != DataGridViewAutoSizeRowsModeInternal.None)
                    {
                        int height = dataGridViewRow.ThicknessInternal;
                        if (rowVisible)
                        {
                            // Cache row's height before potential autosizing occurs
                            // Valid operation even for shared rows
                            dataGridViewRow.CachedThickness = height;
                            if (!((autoSizeRowsModeInternal & DataGridViewAutoSizeRowsModeInternal.DisplayedRows) != 0 && !rowDisplayed))
                            {
                                AutoResizeRowInternal(rowIndex, MapAutoSizeRowsModeToRowMode(this.autoSizeRowsMode), false /*fixedWidth*/, true /*internalAutosizing*/);
                                autoSizeRow = true;
                            }
                        }
                        else if (height != dataGridViewRow.CachedThickness)
                        {
                            // Rows that are made invisible in the collection take their non-autosized height
                            // Not calling OnRowHeightInfoPushed(...) because rows are autosized
                            // Make sure the affected row is unshared
                            if (dataGridViewRow.Index == -1)
                            {
                                dataGridViewRow = this.Rows[rowIndex];
                            }
                            dataGridViewRow.ThicknessInternal = Math.Max(dataGridViewRow.MinimumHeight, dataGridViewRow.CachedThickness);
                        }
                    }

                    // Auto size columms also if needed
                    DataGridViewAutoSizeColumnCriteriaInternal autoSizeColumnCriteriaFilter = DataGridViewAutoSizeColumnCriteriaInternal.AllRows;
                    if (rowDisplayed)
                    {
                        autoSizeColumnCriteriaFilter |= DataGridViewAutoSizeColumnCriteriaInternal.DisplayedRows;
                    }
                    if (rowVisible && this.Rows.GetRowCount(DataGridViewElementStates.Visible) > 1)
                    {
                        // Columns can only expand, and not collapse.
                        AdjustExpandingColumns(autoSizeColumnCriteriaFilter, rowIndex);
                    }
                    else
                    {
                        AutoResizeAllVisibleColumnsInternal(autoSizeColumnCriteriaFilter, true /*fixedHeight*/);
                    }

                    if (autoSizeRow)
                    {
                        // Second round of row autosizing
                        AutoResizeRowInternal(rowIndex, MapAutoSizeRowsModeToRowMode(this.autoSizeRowsMode), true /*fixedWidth*/, true /*internalAutosizing*/);
                    }
                    break;
                }
            }

            DataGridViewRowStateChangedEventHandler eh = this.Events[EVENT_DATAGRIDVIEWROWSTATECHANGED] as DataGridViewRowStateChangedEventHandler;
            if (eh != null && !this.dataGridViewOper[DATAGRIDVIEWOPER_inDispose] && !this.IsDisposed)
            {
                eh(this, e);
            }

            if (e.StateChanged == DataGridViewElementStates.ReadOnly &&
                rowIndex == this.ptCurrentCell.Y &&
                !this.dataGridViewOper[DATAGRIDVIEWOPER_inReadOnlyChange])
            {
                VerifyImeRestrictedModeChanged();

                if ((newState & DataGridViewElementStates.ReadOnly) == 0 &&
                    !this.ReadOnly &&
                    !this.Columns[this.ptCurrentCell.X].ReadOnly &&
                    ColumnEditable(this.ptCurrentCell.X) &&
                    !this.IsCurrentCellInEditMode &&
                    (this.EditMode == DataGridViewEditMode.EditOnEnter ||
                    (this.EditMode != DataGridViewEditMode.EditProgrammatically && this.CurrentCellInternal.EditType == null)))
                {
                    // Current row becomes read/write. Enter editing mode.
                    BeginEditInternal(true /*selectAll*/);
                }
            }
        }
Пример #15
0
 private void m_gridFeatures_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
 {
     if ((e.Row.State & DataGridViewElementStates.Selected) != 0)
         e.Row.Selected = false;
 }
        internal void OnDataGridViewElementStateChanged(DataGridViewElement element, int index, DataGridViewElementStates elementState)
        {
            DataGridViewColumn dataGridViewColumn = element as DataGridViewColumn;
            if (dataGridViewColumn != null)
            {
                DataGridViewColumnStateChangedEventArgs dgvcsce = new DataGridViewColumnStateChangedEventArgs(dataGridViewColumn, elementState);

                OnColumnStateChanged(dgvcsce);
            }
            else
            {
                DataGridViewRow dataGridViewRow = element as DataGridViewRow;
                if (dataGridViewRow != null)
                {
                    DataGridViewRowStateChangedEventHandler eh = this.Events[EVENT_DATAGRIDVIEWROWSTATECHANGED] as DataGridViewRowStateChangedEventHandler;

                    if (eh != null && dataGridViewRow.DataGridView != null && dataGridViewRow.Index == -1)
                    {
                        dataGridViewRow = this.Rows[index];
                    }

                    DataGridViewRowStateChangedEventArgs dgvrsce = new DataGridViewRowStateChangedEventArgs(dataGridViewRow, elementState);

                    OnRowStateChanged(dataGridViewRow.Index == -1 ? index : dataGridViewRow.Index, dgvrsce);
                }
                else
                {
                    DataGridViewCell dataGridViewCell = element as DataGridViewCell;
                    if (dataGridViewCell != null)
                    {
                        DataGridViewCellStateChangedEventArgs dgvcsce = new DataGridViewCellStateChangedEventArgs(dataGridViewCell, elementState);

                        OnCellStateChanged(dgvcsce);
                    }
                }
            }

            if ((elementState & DataGridViewElementStates.Selected) == DataGridViewElementStates.Selected)
            {
                if (this.noSelectionChangeCount > 0)
                {
                    this.dataGridViewState2[DATAGRIDVIEWSTATE2_raiseSelectionChanged] = true;
                }
                else
                {
                    OnSelectionChanged(EventArgs.Empty);
                }
            }
        }
        internal void OnRemovedRow_PostNotification(DataGridViewRow dataGridViewRow, Point newCurrentCell)
        {
            // Update current cell if needed
            if (newCurrentCell.Y != -1)
            {
                Debug.Assert(this.ptCurrentCell.X == -1);
                bool success = SetAndSelectCurrentCellAddress(newCurrentCell.X, 
                                                              newCurrentCell.Y, 
                                                              true /*setAnchorCellAddress*/, 
                                                              false /*validateCurrentCell*/, 
                                                              false /*throughMouseClick*/,
                                                              false /*clearSelection*/,
                                                              false /*forceCurrentCellSelection*/);
                Debug.Assert(success);
            }

            // Raise SelectionChange event if needed
            FlushSelectionChanged();

            bool rowDisplayed = dataGridViewRow.DataGridView == null && dataGridViewRow.Displayed;

            // Raise RowStateChanged event for Displayed state of deleted row
            if (rowDisplayed)
            {
                dataGridViewRow.DisplayedInternal = false;
                DataGridViewRowStateChangedEventArgs dgvrsce = new DataGridViewRowStateChangedEventArgs(dataGridViewRow, DataGridViewElementStates.Displayed);
                OnRowStateChanged(-1 /*rowIndex*/, dgvrsce);
            }

            // Rows that are removed from the collection take their non-autosized height
            // Note that in some edge cases, the dev could have changed:
            //     - the grid's AutoSizeRowsMode
            //     - the row's Height
            // in a RowsRemoved event handler for example, in which case using the CachedThickness may be wrong.
            // At least we make sure the row is not sized smaller than its minimum height.
            if (this.autoSizeRowsMode != DataGridViewAutoSizeRowsMode.None && dataGridViewRow.ThicknessInternal != dataGridViewRow.CachedThickness)
            {
                dataGridViewRow.ThicknessInternal = Math.Max(dataGridViewRow.MinimumHeight, dataGridViewRow.CachedThickness);
            }

            // Auto size columms also if needed
            DataGridViewAutoSizeColumnCriteriaInternal autoSizeColumnCriteriaFilter = DataGridViewAutoSizeColumnCriteriaInternal.AllRows;
            if (rowDisplayed)
            {
                autoSizeColumnCriteriaFilter |= DataGridViewAutoSizeColumnCriteriaInternal.DisplayedRows;
            }
            bool columnAutoSized = AutoResizeAllVisibleColumnsInternal(autoSizeColumnCriteriaFilter, true /*fixedHeight*/);
            bool fixedColumnHeadersHeight = this.ColumnHeadersHeightSizeMode != DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            bool fixedRowHeadersWidth = this.rowHeadersWidthSizeMode == DataGridViewRowHeadersWidthSizeMode.EnableResizing ||
                                        this.rowHeadersWidthSizeMode == DataGridViewRowHeadersWidthSizeMode.DisableResizing;

            if (fixedRowHeadersWidth && !columnAutoSized)
            {
                // No need to autosize the column headers when the row headers and columns don't change.
                fixedColumnHeadersHeight = true;
            }

            // Auto size column headers
            if (!fixedColumnHeadersHeight)
            {
                AutoResizeColumnHeadersHeight(fixedRowHeadersWidth, true /*fixedColumnsWidth*/);
            }

            // Auto size row headers
            if (!fixedRowHeadersWidth)
            {
                AutoResizeRowHeadersWidth(this.rowHeadersWidthSizeMode, true /*fixedColumnHeadersHeight*/, true /*fixedRowsHeight*/);
            }

            if (!fixedColumnHeadersHeight && !fixedRowHeadersWidth)
            {
                // Second round of column headers autosizing
                AutoResizeColumnHeadersHeight(true /*fixedRowHeadersWidth*/, true /*fixedColumnsWidth*/);
            }
        }
Пример #18
0
        private void dgvDSNV_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
        {
            if (btnThemMoi.Enabled == true)
                if (dgvDSNV.SelectedRows.Count != 0)
                {
                    //txtTaiKhoanNV.ReadOnly = true;
                    //btnLamLai.Enabled = false;
                    //btnHuy.Enabled = false;
                    //btnThemMoi.Enabled = true;
                    //cboTrangThaiNV.Enabled = true;

                    txtTaiKhoanNV.Text = dgvDSNV.SelectedRows[0].Cells[0].Value.ToString();

                    txtMkNV.Text = dgvDSNV.SelectedRows[0].Cells[1].Value.ToString();
                    _flag = true;

                    if (dgvDSNV.SelectedRows[0].Cells[2].Value != null)
                        txtHoVaTenDemNV.Text = dgvDSNV.SelectedRows[0].Cells[2].Value.ToString();
                    else
                        txtHoVaTenDemNV.Text = string.Empty;

                    if (dgvDSNV.SelectedRows[0].Cells[3].Value != null)
                        txtTenNV.Text = dgvDSNV.SelectedRows[0].Cells[3].Value.ToString();
                    else
                        txtTenNV.Text = string.Empty;

                    dtpNgaySinhNV.Value = Get_NgaySinh(dgvDSNV.SelectedRows[0].Cells[0].Value.ToString());

                    if (dgvDSNV.SelectedRows[0].Cells[5].Value != null)
                        cboGioiTinhNV.Text = dgvDSNV.SelectedRows[0].Cells[5].Value.ToString();
                    else
                        cboGioiTinhNV.Text = cboGioiTinhNV.Items[0].ToString();

                    if (dgvDSNV.SelectedRows[0].Cells[6].Value != null)
                        txtSDTNV.Text = dgvDSNV.SelectedRows[0].Cells[6].Value.ToString();
                    else
                        txtSDTNV.Text = string.Empty;

                    if (dgvDSNV.SelectedRows[0].Cells[7].Value != null)
                        txtDiaChiNV.Text = dgvDSNV.SelectedRows[0].Cells[7].Value.ToString();
                    else
                        txtDiaChiNV.Text = string.Empty;

                    foreach (var item in cboTrangThaiNV.Items)
                    {
                        svcRefQLPM.TrangThaiNV tmp = item as svcRefQLPM.TrangThaiNV;
                        if (tmp.TenTrangThaiNV.Equals(dgvDSNV.SelectedRows[0].Cells[8].Value.ToString()))
                            cboTrangThaiNV.SelectedItem = item;
                    }

                    _proxy.Get_dsChucNang_By_taikhoanNV(dgvDSNV.SelectedRows[0].Cells[0].Value.ToString());
                }
        }
 internal void OnClearedRows()
 {
     // Raise the RowStateChanged(Displayed->false) events
     foreach (DataGridViewRow dataGridViewRow in this.lstRows)
     {
         if (dataGridViewRow.Displayed)
         {
             dataGridViewRow.DisplayedInternal = false;
             DataGridViewRowStateChangedEventArgs dgvrsce = new DataGridViewRowStateChangedEventArgs(dataGridViewRow, DataGridViewElementStates.Displayed);
             OnRowStateChanged(-1 /*rowIndex*/, dgvrsce);
         }
     }
     this.lstRows.Clear();
 }
Пример #20
0
		protected internal virtual void OnRowStateChanged (int rowIndex, DataGridViewRowStateChangedEventArgs e)
		{
			DataGridViewRowStateChangedEventHandler eh = (DataGridViewRowStateChangedEventHandler)(Events [RowStateChangedEvent]);
			if (eh != null) eh (this, e);
		}
Пример #21
0
        private void dgvAutorizaciones_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
        {
            if (e.StateChanged != DataGridViewElementStates.Selected) return;

            int iAutorizacionID = Util.Entero(e.Row.Cells["AutorizacionID"].Value);
            this.LlenarDetalle(iAutorizacionID);
        }
Пример #22
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Called when the row state changed.
		/// </summary>
		/// <param name="sender">The sender.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewRowStateChangedEventArgs"/>
		/// instance containing the event data.</param>
		/// ------------------------------------------------------------------------------------
		protected virtual void OnRowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
		{
			if (e.StateChanged != DataGridViewElementStates.Visible ||
				m_grid.DisplayedRowCount(true) == 0)
			{
				return;
			}

			OnShown(sender, EventArgs.Empty);
			SetLastVisibleRowUnsizable();
		}
Пример #23
0
        private void dgvItems_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
        {
            decimal decTotalPayable = 0;
            decimal decTemp = 0;

            foreach (DataGridViewRow dr in dgvItems.SelectedRows)
            {
                decTemp = 0;
                decimal.TryParse(dr.Cells["Balance"].Value.ToString(), out decTemp);
                decTotalPayable += decTemp;
            }
            lblBalanceSelected.Text = decTotalPayable.ToString("#,##0.#0");
        }
Пример #24
0
 private void dtgvCaixa_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
 {
     if (e.Row.Index > -1)
     {
         if (dtMovimentacoes.Rows[e.Row.Index]["movTipo"].Equals("Entrada")) //imagem seta
             dtgvCaixa.Rows[e.Row.Index].Cells["img"].Value = imageList1.Images[1];
         else
             dtgvCaixa.Rows[e.Row.Index].Cells["img"].Value = imageList1.Images[0];
         if(!dtgvCaixa.Rows[e.Row.Index].Cells["valor"].Value.ToString().Contains("R$"))
             dtgvCaixa.Rows[e.Row.Index].Cells["valor"].Value = util.moneyFormata(dtgvCaixa.Rows[e.Row.Index].Cells["valor"].Value.ToString());
     }
 }
Пример #25
0
        private void dataGridView1_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
        {
            //int index = 0;
            //if (dataGridView1.CurrentRow != null)
            //    index = dataGridView1.CurrentRow.Index;
            //if (dataGridView1.Rows[index].Cells["商品编号"].Value == null || dataGridView1.Rows[index].Cells["商品编号"].Value.ToString().Trim() == "")
            //    return;
            //if (dataGridView1.Rows[index].Cells["库存"].Value == null)
            //    return;

            //if (dataGridView1.Rows[index].Cells["库存"].Value.ToString().Trim() != "")
            //{
            //    string matId = dataGridView1.SelectedRows[0].Cells["商品编号"].Value.ToString().Trim();
            //    int matType = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["类型"].Value.ToString().Trim().Substring(0, 1));

            //    dataGridView1.SelectedRows[0].Cells["库存"].Value = ReceiptModCfg.GetStockNum(this.SStorehouseId, matId, matType).stockNum;
            //}
        }
Пример #26
0
        private void dtgvDesp_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
        {
            if (e.Row.Index > -1)
            {
                if (dtDesp.Rows[e.Row.Index]["desp_dtpg"].ToString() != "")
                    dtgvDesp.Rows[e.Row.Index].Cells["ispago"].Value = imageList1.Images[0];
                else
                    dtgvDesp.Rows[e.Row.Index].Cells["ispago"].Value = new Bitmap(32, 32);

                if (!dtgvDesp.Rows[e.Row.Index].Cells["desp_valor"].Value.ToString().Contains("R$"))
                    dtgvDesp.Rows[e.Row.Index].Cells["desp_valor"].Value = util.moneyFormata(dtgvDesp.Rows[e.Row.Index].Cells["desp_valor"].Value.ToString());

                if (!dtgvDesp.Rows[e.Row.Index].Cells["desp_valorpg"].Value.ToString().Contains("R$"))
                    dtgvDesp.Rows[e.Row.Index].Cells["desp_valorpg"].Value = util.moneyFormata(dtgvDesp.Rows[e.Row.Index].Cells["desp_valorpg"].Value.ToString());

            }
        }
Пример #27
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Called when the visible property of the row changed.
		/// </summary>
		/// <param name="sender">The sender.</param>
		/// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event
		/// data.</param>
		/// ------------------------------------------------------------------------------------
		protected void OnRowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
		{
			if (e.Row != OwningRow || e.StateChanged != DataGridViewElementStates.Visible)
				return;

			ControlVisible = OwningColumn.Index >= 0 ? OwningColumn.Visible && OwningRow.Visible : false;
		}
Пример #28
0
 void DataGridViewRowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
 {
     DataGridViewRow row = e.Row;
     DataGridViewCell cell = row.Cells[0];
     string str = (string)row.HeaderCell.Value;
     try {
         if (str == "Ping") {
             string text = (string)cell.Value;
             if (text == "" || text.Contains(GUITexts.get("reponds")))
                 return;
             try {
                 if (compInfo.Network.Ping(text))
                     cell.Value = text + " "+GUITexts.get("responds");
                 else
                     cell.Value = text + " "+GUITexts.get("doesn't respond");
             }
             catch (Exception) {
                 cell.Value = text + " " + GUITexts.get("doesn't respond");
             }
         }
     }
     catch (Exception) { }
 }
		/// <summary>
		/// Tracks changes to the selected row
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void dataGridView1_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
		{
			if (!m_isDisplaying)
			{
				if (e.StateChanged == DataGridViewElementStates.Selected)
				{
					m_selectedAddExpressionRow = e.Row.Index;
				}
			}
		}
Пример #30
0
 private void VisitedSystemsGrid_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
 {
     if (e.StateChanged != DataGridViewElementStates.Selected) return;
     var row = (SystemGridRow)e.Row.DataBoundItem;
     _currentStarSystem = StarSystemServices.GetByStarSystemId(row.Id);
     RefreshStarSystemControls();
 }