Tap on List vs Load More

3 posts, 1 answers
  1. bento
    bento avatar
    35 posts
    Member since:
    Aug 2013

    Posted 30 Sep 2013 Link to this post

    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. Answer
    Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 01 Oct 2013 Link to this post

    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.
  3. DevCraft banner
  4. bento
    bento avatar
    35 posts
    Member since:
    Aug 2013

    Posted 01 Oct 2013 Link to this post

    Hi Kiril,

    Thanks for sharing new Property, I didnt know it exist  :)
Back to Top