private void txtnombreprod_TextChanged(object sender, EventArgs e) { var opc = new OperacionProducto(); opc.llenardata(dataGridView3); if (txtnombreprod.Text != "") { dataGridView3.CurrentCell = null; foreach (DataGridViewRow r in dataGridView3.Rows) { r.Visible = false; } foreach (DataGridViewRow r in dataGridView3.Rows) { foreach (DataGridViewCell c in r.Cells) { if ((c.Value.ToString().ToUpper().IndexOf(txtnombreprod.Text.ToUpper())) == 0) { r.Visible = true; break; } } } } if (txtnombreprod.Text == "") { opc.llenardata(dataGridView3); } }
public FrmTraslado() { InitializeComponent(); var opc = new OperacionProducto(); opc.llenardata(dataGridView3); AutoScroll = true; }
private void cmbbodega_TextChanged(object sender, EventArgs e) { var opc = new OperacionProducto(); opc.llenardata(dataGridView1); var idbodega = (Convert.ToInt32(cmbbodega.SelectedValue)); string pro = Convert.ToString(idbodega); label20.Text = pro; foreach (DataGridViewRow Row in dataGridView1.Rows) { String strFila = Row.Index.ToString(); string Valor = Convert.ToString(Row.Cells["IdBodega"].Value); if (Valor == label20.Text) { dataGridView1.Rows[Convert.ToInt32(strFila)].DefaultCellStyle.BackColor = Color.SkyBlue; } } }
private void button1_Click(object sender, EventArgs e) { var opc = new OperacionProducto(); opc.llenardata(dataGridView3); var idbodega = (Convert.ToInt32(comboBox4.SelectedValue)); string pro = Convert.ToString(idbodega); label3.Text = pro; foreach (DataGridViewRow Row in dataGridView3.Rows) { String strFila = Row.Index.ToString(); string Valor = Convert.ToString(Row.Cells["IdBodega"].Value); if (Valor == label3.Text) { dataGridView3.Rows[Convert.ToInt32(strFila)].DefaultCellStyle.BackColor = Color.MediumPurple; } } }