After reading a number of posts and seeing some video, it seems that getting the keyboard to work with first your computer and then switching to the ipad isn't as easy as it should be. Not Apple like to be sure.
First you have to delete the bluetooth device shown in the window of system preferences under the bluetooth icon. Only after doing this can the keyboard be free to pair with the ipad. Some have said all you had to do was disconnect in the software in the status menu bar, where it says devices and then disconnect. But I found that it just came back when I tried to pair it with the ipad. So in the end the whole device needs deleting.
Hopefully Apple will have a software fix soon. Jon L
Here is some video on just how to do it.
How to video