Hi i am using Link button under CommandTemplate, During runtime it shows only one link button as i am given.
But when i made an sorting or some filtering the Linkbutton repeats and shown two times at the area where i have placed.
I am sending you a simple runnable application which handles the desired functionality. Please give it a try and let me know what is the difference in your scenario.
More information about Command item template is available in this help article.