What's the best way to cook BBQ ribs in the oven and grill?
The goal with ribs is "low and slow" cooking to break down connective tissue.  But a quick sear will help to lock in juices and provide a good smoky flavor.  I find it's preferable to do this first so that the smokiness can work its way into the meat over the slow cook to come.

After seasoning, I would start with a sear on your grill over direct heat (8-10 minutes per side).  Then, either move to a very low indirect heat on the grill and cover, which will provide a more smoky flavor, or transfer to your oven at a very low temperature (most home ovens go down to about 250F which is what I'd use).  Baste both sides every half hour or so if you're using sauce.  It should take about 2-3 hours at this low temperature to get good results, although you can let it go a lot longer if you want.  I would have no problem at all cooking ribs for 6, 8, or 10 hours assuming you've got the time.

If you're cooking on the grill the whole time, the smoke will help create a delicious glaze.  If in the oven and the glaze isn't as thick as you'd like by the time you're ready to serve, you can crank on the broiler and place the ribs underneath for just a couple minutes to dry out the glaze a bit.

You do not need to wrap them in foil during cooking if you have quality ribs and cook them slow.  The only time I'd wrap them in foil would be at the very end once you have finished cooking, in order to keep them warm until you're ready to serve.