public DataGridViewRow ()
		{
			cells = new DataGridViewCellCollection(this);
			minimumHeight = 3;
			height = -1;
			explicit_height = -1;
			headerCell = new DataGridViewRowHeaderCell();
			headerCell.SetOwningRow (this);
			accessibilityObject = new AccessibleObject ();
			SetState (DataGridViewElementStates.Visible);
		}
Exemplo n.º 2
0
		protected override DataGridViewCellCollection CreateCellsInstance()
		{
			DataGridViewCellCollection viewCellCollection = new DataGridViewCellCollection((DataGridViewRow)this);
			for (int index = 0; index < this.cellCount; ++index)
				viewCellCollection.Add((DataGridViewCell)new DataGridViewTextBoxCell());
			return viewCellCollection;
		}
 private Approvvigionamento GetSelectedApprovvigionamento(DataGridViewCellCollection cells)
 {
     Approvvigionamento appr = new Approvvigionamento();
     IEnumerator enumerator = cells.GetEnumerator();
     while (enumerator.MoveNext())
     {
         DataGridViewTextBoxCell cell = (DataGridViewTextBoxCell)enumerator.Current;
         FillField(appr, cell.Value, cell.OwningColumn.DataPropertyName);
     }
     return appr;
 }
Exemplo n.º 4
0
 protected override DataGridViewCellCollection CreateCellsInstance()
 {
   DataGridViewCellCollection viewCellCollection = new DataGridViewCellCollection((DataGridViewRow) this)
   {
     (DataGridViewCell) new DataGridViewTextBoxCell(),
     (DataGridViewCell) new DataGridViewTextBoxCell(),
     (DataGridViewCell) new DataGridViewTextBoxCell(),
     (DataGridViewCell) new DataGridViewTextBoxCell()
   };
   return base.CreateCellsInstance();
 }
Exemplo n.º 5
0
        public FormNuevaHabitacion(int cod, DataGridViewCellCollection cells)
        {
            this.x = cod;
            InitializeComponent();

            lbIDHabitacion.Text = cells[0].Value.ToString();
            lbIDHotel.Text = cells[1].Value.ToString();
            tbNumero.Text = cells[2].Value.ToString();
            tbPiso.Text = cells[3].Value.ToString();
            cmbVista.Text = cells[4].Value.ToString();
            cmbTHabitacion.Hide();
            label7.Hide();
            btnCrear.Text = "Actualizar";

            cmbVista.Items.Add("S");
            cmbVista.Items.Add("N");
        }
Exemplo n.º 6
0
        public FormNuevoHotel(int cod, DataGridViewCellCollection cells)
        {
            this.x = cod;
            InitializeComponent();
            lbIdHotel.Text = cells[0].Value.ToString();
            tbNombre.Text = cells[1].Value.ToString();
            tbMail.Text = cells[5].Value.ToString();
            tbTelefono.Text = cells[6].Value.ToString();
            tbCalle.Text = cells[7].Value.ToString();
            tbNroCalle.Text = cells[9].Value.ToString();
            tbCantEstrellas.Text = cells[2].Value.ToString();
            nudRecarga.Text = cells[10].Value.ToString();
            tbCiudad.Text = cells[3].Value.ToString();
            tbPais.Text = cells[4].Value.ToString();

            btnCrear.Text = "Actualizar";
        }
Exemplo n.º 7
0
        public void CreateCells(DataGridView dataGridView)
        {
            if (dataGridView == null)
            {
                throw new ArgumentNullException("DataGridView is null.");
            }
            if (dataGridView.Rows.Contains(this))
            {
                throw new InvalidOperationException("The row already exists in the DataGridView.");
            }
            DataGridViewCellCollection newCellCollection = new DataGridViewCellCollection(this);

            foreach (DataGridViewColumn column in dataGridView.Columns)
            {
                if (column.CellTemplate == null)
                {
                    throw new InvalidOperationException("Cell template not set in column: " + column.Index.ToString() + ".");
                }
                newCellCollection.Add((DataGridViewCell)column.CellTemplate.Clone());
            }
            cells = newCellCollection;
        }
Exemplo n.º 8
0
        public FormClienteNuevo(int cod, DataGridViewCellCollection cells)
        {
            this.x = cod;
            InitializeComponent();

            id_cliente = cells[0].Value.ToString();

            txbNombre.Text = cells[1].Value.ToString();
            txbApellido.Text = cells[2].Value.ToString();
            cbTipoDeDocumento.Text = cells[3].Value.ToString();
            txbDocumentoNumero.Text = cells[4].Value.ToString();
            txbMail.Text = cells[5].Value.ToString();
            txbTelefono.Text = cells[6].Value.ToString();
            dtpFecha.Text = cells[7].Value.ToString();
            txbDireccion.Text = cells[8].Value.ToString();
            //txbNumero.Text = cells[9].Value.ToString();
            txbPiso.Text = cells[10].Value.ToString();
            txbDpto.Text = cells[11].Value.ToString();
            //txbCodigoPostal.Text = cells[12].Value.ToString();
            txbLocalidad.Text = cells[12].Value.ToString();
            CrearButton.Text = "Actualizar";
        }
Exemplo n.º 9
0
 protected virtual DataGridViewCellCollection CreateCellsInstance()
 {
     cells = new DataGridViewCellCollection(this);
     return(cells);
 }
		protected virtual DataGridViewCellCollection CreateCellsInstance ()
		{
			cells = new DataGridViewCellCollection(this);
			return cells;
		}
		public void CreateCells (DataGridView dataGridView)
		{
			if (dataGridView == null) {
				throw new ArgumentNullException("DataGridView is null.");
			}
			if (dataGridView.Rows.Contains(this)) {
				throw new InvalidOperationException("The row already exists in the DataGridView.");
			}
			DataGridViewCellCollection newCellCollection = new DataGridViewCellCollection(this);
			foreach (DataGridViewColumn column in dataGridView.Columns) {
				if (column.CellTemplate == null) {
					throw new InvalidOperationException("Cell template not set in column: " + column.Index.ToString() + ".");
				}
				newCellCollection.Add((DataGridViewCell) column.CellTemplate.Clone());
			}
			cells = newCellCollection;
		}
Exemplo n.º 12
0
        private void dGV_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            var c = new DataGridViewCellCollection(dGV.Rows[e.RowIndex]);
            c = dGV.Rows[e.RowIndex].Cells;

            var cs = new List<string>();

            for (int i = 0; i < c.Count; i++ )
                cs.Add(c[i].Value.ToString());

            dGV_tgt.Rows.Add(cs.ToArray());
        }
Exemplo n.º 13
0
 public FormBajaHotel(DataGridViewCellCollection cells)
 {
     InitializeComponent();
     lbNombre.Text = cells[1].Value.ToString();
     lbIdHotel.Text = cells[0].Value.ToString();
 }
Exemplo n.º 14
0
 /// <summary>
 /// Returns an observable sequence wrapping the CollectionChanged event on the DataGridViewCellCollection instance.
 /// </summary>
 /// <param name="instance">The DataGridViewCellCollection instance to observe.</param>
 /// <returns>An observable sequence wrapping the CollectionChanged event on the DataGridViewCellCollection instance.</returns>
 public static IObservable <EventPattern <CollectionChangeEventArgs> > CollectionChangedObservable(this DataGridViewCellCollection instance)
 {
     return(Observable.FromEventPattern <CollectionChangeEventHandler, CollectionChangeEventArgs>(
                handler => instance.CollectionChanged += handler,
                handler => instance.CollectionChanged -= handler));
 }
Exemplo n.º 15
0
 public Student(DataGridViewCellCollection studentInfo)
 {
     FullName = studentInfo[1].Value.ToString();
     Sex = studentInfo[2].Value.ToString();
     Address = studentInfo[3].Value.ToString();
     Phone = studentInfo[4].Value.ToString();
     Email = studentInfo[5].Value.ToString();
     Birth = studentInfo[6].Value.ToString();
     Education = studentInfo[7].Value.ToString();
     Medical = studentInfo[8].Value.ToString();
     Nationality = studentInfo[9].Value.ToString();
     Hobby = studentInfo[10].Value.ToString();
     Dormitory = (bool)studentInfo[11].Value;
     Group = studentInfo[12].Value.ToString();
     Other = studentInfo[13].Value.ToString();
 }
Exemplo n.º 16
0
 public Instructor(DataGridViewCellCollection instructorInfo)
 {
     FullName = instructorInfo[1].Value.ToString();
     Sex = instructorInfo[2].Value.ToString();
     Address = instructorInfo[3].Value.ToString();
     Phone = instructorInfo[4].Value.ToString();
     Email = instructorInfo[5].Value.ToString();
     Education = instructorInfo[6].Value.ToString();
     Department = instructorInfo[7].Value.ToString();
     Post = instructorInfo[8].Value.ToString();
     Start = instructorInfo[9].Value.ToString();
     Other = instructorInfo[10].Value.ToString();
 }
Exemplo n.º 17
0
 public Group(DataGridViewCellCollection groupInfo)
 {
     Code = groupInfo[1].Value.ToString();
     Specialty = groupInfo[2].Value.ToString();
     StudyForm = groupInfo[3].Value.ToString();
     Curator = groupInfo[4].Value.ToString();
 }
Exemplo n.º 18
0
 /// <summary>
 /// 获取数据行的设备目标位置参数
 /// 记录包含字段【访问方式】(TCP/UDP/SerialPort)、【端口】(60000/COM1)、【地址】(192.168.1.146)
 /// </summary>
 /// <param name="dr">数据记录</param>
 /// <returns></returns>
 private CommiTarget getTarget(DataGridViewCellCollection cells)
 {
     if (null == cells) return null;
     CommiTarget target = new CommiTarget();
     CommiType commiType = CommiType.UDP;
     string stype = Convert.ToString(cells["通讯类别"].Value);
     switch (stype)
     {
         case "TCP/IP(局域网)":
             commiType = CommiType.TCP; break;
         case "UDP/IP(局域网)":
             commiType = CommiType.UDP; break;
         default:
             commiType = CommiType.SerialPort; break;
     }
     try
     {
         if (CommiType.SerialPort == commiType)
         {
             string portname = Convert.ToString(cells["串口"].Value);
             int baudRate = Convert.ToInt16(cells["波特率"].Value);
             int dataBits = Convert.ToInt16(cells["数据位"].Value);
             decimal s = Convert.ToDecimal(cells["停止位"].Value);
             StopBits sb = StopBits.None;
             if (1 == s) sb = StopBits.One;
             else if (2 == s) sb = StopBits.Two;
             else if (1 < s && s < 2) sb = StopBits.OnePointFive;
             target.SetProtocolParam(portname, baudRate, Parity.None, dataBits, sb);
         }
         else
         {
             string addr = Convert.ToString(cells["IP地址"].Value);
             int port = Convert.ToInt32(cells["端口"].Value);
             target.SetProtocolParam(addr, port, commiType);
         }
         target.setProtocol(Protocol.PTLPark);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "通讯设备提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return null;
     }
     return target;
 }