In the midst of a heart-rending divorce, “Little House on the Prairie” star Melissa Gilbert will compete on the next season of “Dancing with the Stars,” The ENQUIRER has learned exclusively.


Melissa, 47, is getting ready to rumba by studying the past season’s dancers.


“After so much pain and heartache recently, it’s nice to see Melissa with something to smile about,” said an insider. “Her upcoming appearance is giving her something to look forward to after her split from her husband.


 Melissa and her husband of 16 years, “Scarecrow and Mrs. King” star Bruce Boxleitner, separated on March 1. The couple continued to live together for a while and attempted to reconcile, but Bruce finally moved out when the couple realized their relationship was not going to work.


Melissa was also deeply disappointed when she lost out on a role in the new version of the nighttime soap “Dallas.” Producers chose “Desperate Housewives” star Brenda Strong instead.


Adding to her woes, Melissa came down with a severe bout of colitis – inflammation of the colon – after undergoing a colonoscopy recently.


“Melissa has had one bad break after another,” added the source. “It’s nice to see her luck is changing by landing on ‘Dancing with the Stars.’