I am not sure how suitable this is for your scenario, but one way to do this is to just ignore the click event based on the item:
void ClickOnItem(object sender, ItemClickEventArgs e)
{
var item = (SampleDataItem)e.ClickedItem;
// ignore one specific item - here we use UniqueId, but it could be
// any attribute...
if (string.Compare(item.UniqueId, "Group-1-Item-1") == 0)
return;
// normal processing here...
...
}
Update - to add a click event programmatically, you have to name your grid (x:Name
line):
<GridView Grid.Column="0" Grid.Row="1"
x:Name="myGridView"
SelectionMode="None"
IsItemClickEnabled="True"
ItemClick="ClickOnItem">
</GridView>
and then in the code behind, add the handler in the constructor of the page:
public PageConstructor()
{
this.InitializeComponent();
myGridView.ItemClick += ClickOnItem;
}