private void CmdAddItem_Click(object sender, EventArgs e) { int n_row = 0; DataTable dtResult = new DataTable(); CN_alm_inventario o_item = new CN_alm_inventario(); string c_dato = ""; o_item.mysConec = mysConec; string c_cadIN = funFlex.Flex_ObtenerDatosCol(FgItems, 7); dtResult = o_item.FiltrarSelccionarItems(STU_SISTEMA.EMPRESAID, c_cadIN); if (dtResult != null) { if (dtResult.Rows.Count != 0) { for (n_row = 0; n_row <= dtResult.Rows.Count - 1; n_row++) { FgItems.Rows.Count = FgItems.Rows.Count + 1; c_dato = dtResult.Rows[n_row]["c_codpro"].ToString(); FgItems.SetData(FgItems.Rows.Count - 1, 1, c_dato); c_dato = dtResult.Rows[n_row]["c_despro"].ToString(); FgItems.SetData(FgItems.Rows.Count - 1, 2, c_dato); c_dato = dtResult.Rows[n_row]["c_abrpre"].ToString(); FgItems.SetData(FgItems.Rows.Count - 1, 3, c_dato); FgItems.SetData(FgItems.Rows.Count - 1, 4, "0.00"); c_dato = "18.00"; FgItems.SetData(FgItems.Rows.Count - 1, 5, c_dato); FgItems.SetData(FgItems.Rows.Count - 1, 6, "0.00"); c_dato = Convert.ToInt32(dtResult.Rows[n_row]["n_id"]).ToString(); FgItems.SetData(FgItems.Rows.Count - 1, 7, c_dato); } } } }