-
May 1st, 2014, 11:43 PM
#1
Listview, users create click event when scrolling
I have a Windows 8 app. It has a list view with 2 TextBlocks and a CheckBox in 3 columns. I am using an ObservableCollection as the data source. It all works well, but some of the people using it end up firing an ItemClick event when they are just trying to scroll the list.
What I would like to do it so find which column they click on when they click, or the coordinates of the click on the screen, so I can make it so I only use the click event if it is in a certain place. ie I'll ignore all click events unless they are in the left column. But I can't figure out how to find where in the listview they clicked.
Any help will be appreciated.
Code:
<ListView Name="ListViewClients" Margin="10,170,10,10" BorderThickness="1" FontSize="36" IsItemClickEnabled="True" ItemClick="ClientClicked">
<ListView.ItemTemplate>
<DataTemplate>
<Grid Width="650" VerticalAlignment="Top" HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="280" />
<ColumnDefinition Width="320" />
<ColumnDefinition Width="50" />
</Grid.ColumnDefinitions>
<TextBlock x:Name="FirstName" Grid.Column="0" Text="{Binding FirstName}" FontSize="36" />
<TextBlock x:Name="LastName" Grid.Column="1" Text="{Binding LastName}" FontSize="36" />
<CheckBox Grid.Column="2" Height="40" Width="40" IsChecked="{Binding Attending}" FontSize="36" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|