Ionic compounds are composed of two elements with high degrees of electronegativity, such as elements in group 1 or 2 and group 17, the halogens. A good example would be sodium chloride, NaCl, good old table salt. The ionic bond between the sodium and the chlorine is so strong, you would have to heat a sample to 801 degrees Celsius to get the sample to melt. That is 8 times the boiling point of water! When sodium chloride is in its solid state, there are no available electrons that may be shifted to facilitate the conduction of electricity. That is why solid ionic compounds will not conduct electricity. One may, however, take that same sample of sodium chloride, and dissolve it into water, making salt water. The ions will separate into the molecules of water, having sodium ions (Na+) and chlorine ions (Cl-), which will conduct the flow of electrons and produce an electrical flow.
For ionic compound to conduct electricity, they need to be dissolved in water. This is because only in water or in a molten form, the ions can dissociate(split) and can move from one elcectode to another. For an ionic compond to conduct electricity, the ions must split up. A positive ion gains the electron at the negative electrode(cathode) and the negative ions lose elctrons at the positive electode(anode) this way, the ions get seaprated from the molecule and they form two separate materials at the electodes. They can form a third material in the solution or as a precipitate.
Ionic compounds can not move in their solid state because the electrons can not move freely. Solids are rigid structures that caused by bond formation. If electrons can not move, there will be no current. Current is the movement of electrons. Electricity works by using current. If there is no current, there is no electricity. Electrons from oppostive poles (positive and negative). Electrons can not move in its soild form. This is why in electrolysis, you need to have a solution to move electrons from anode to the cathode. Liquid is not a rigid structure that can allow for the flow of electrons.