The following forum(s) have migrated to Microsoft Q&A: All English Windows and Windows phone apps forums! Visit Microsoft Q&A to post new questions.
Look at my answer in this thread, you need to do similar script for datagrid too.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=998506&SiteID=1&mode=1
Good Luck