This is a migrated thread and some comments may be shown as answers.

Tap on List vs Load More

2 Answers 42 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
bento
Top achievements
Rank 2
bento asked on 01 Oct 2013, 03:12 AM
Hi,

Let say this code works.. the problem is, why when I tap "Load More" button, List_Tap always trigger also, so it will navigate to OtherPage.xaml ? How to fix it ?

<telerikPrimitives:RadDataBoundListBox x:Name="listBound" Tap="List_Tap" DataVirtualizationMode="OnDemandManual">
    <telerikPrimitives:RadDataBoundListBox.DataVirtualizationItemTemplate>
    <DataTemplate>
             <Button x:Name="btnLoadMore" Tap="btnLoadMore_Tap" />
        </DataTemplate>
    </telerikPrimitives:RadDataBoundListBox.DataVirtualizationItemTemplate>
</telerikPrimitives:RadDataBoundListBox>
 
namespace Testing
{
    public partial class MainPage : PhoneApplicationPage
    {
        private Button getMoreButton;
        public MainPage()
        {
            InitializeComponent();
            this.listBound.DataRequested += this.OnLoadDataRequest;
        }
 
        private async void OnLoadDataRequest(object sender, EventArgs e)
        {
        // API to load data here...
        }
 
        private void btnLoadMore_Tap(object sender, System.Windows.Input.GestureEventArgs
e)
        {
            this.getMoreButton = sender as Button;
 
            if (getMoreButton.Name == "btnLoadMore")
            {
                this.OnLoadDataRequest(DataCategoryToLoad, null);
            }
        }
 
        private void List_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            NavigationService.Navigate(new Uri("/OtherPage.xaml", UriKind.Relative));
        }
    }
}

2 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Stanoev
Telerik team
answered on 01 Oct 2013, 10:22 AM
Hi Benyamin,

Please try the following approach:

private void btnLoadMore_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
    e.Handled = true;
 
    this.getMoreButton = sender as Button;
 
    if (getMoreButton.Name == "btnLoadMore")
    {
        //this.OnLoadDataRequest(DataCategoryToLoad, null);
    }
}
 
Let us know how it goes.

Regards,
Kiril Stanoev
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
bento
Top achievements
Rank 2
answered on 01 Oct 2013, 10:44 AM
Hi Kiril,

Thanks for sharing new Property, I didnt know it exist  :)
Tags
DataBoundListBox
Asked by
bento
Top achievements
Rank 2
Answers by
Kiril Stanoev
Telerik team
bento
Top achievements
Rank 2
Share this question
or