Allowing an Image tap inside expander control

8 posts, 0 answers
  1. Robert Lautenbach
    Robert Lautenbach avatar
    18 posts
    Member since:
    Dec 2009

    Posted 28 May 2013 Link to this post

    I have an radimage   control in side a datalist which is inside an radexpander.  When I tap the row or the arrow icon it shows the expanded detail, however I have an image I want to able to tap, but each time I do,the expnder expands and then fires my other tap event....I want the image to only fire my event. Possible?

    Thanks....,
    Bob
  2. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 29 May 2013 Link to this post

    Hi Robert,

    Thanks for writing.

    I am not quite sure that I correctly understand your scenario. Can you please share some further code or directly attach a sample project that reproduces the scenario so that we can take a thorough look?

    Please note that in order to upload your project you will have to open a new support ticket.

    Regards,
    Deyan
    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. Robert Lautenbach
    Robert Lautenbach avatar
    18 posts
    Member since:
    Dec 2009

    Posted 29 May 2013 Link to this post

    Sure..sorry for the confusion.


    I have a radjumplist.  Inside that jumplist is radexpander control (with content and expanded templated) The jumplist is bound to a collection and the expandercontent section properly displays the data bound to it.  Additionally, the expander works perfectly...it expands and collapses as needed and displays data correctly. Essentailly, I have a master detaill expander set up.

    The issue I am having however, is that I have an image that is displayed in the expandercontent section (not the expanded contect section) and I need that image to fire a custom event I have.  However, because the image is contained within the contect section of the expander, it fires the expand event of the expander and then tries to fire my custom event.  I need to be able to dispay that image without the expander being fired when it is tapped.

    Thanks
    bob
  5. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 30 May 2013 Link to this post

    Hi Robert,

    Thanks for getting back to me.

    I now have a better understanding of your scenario. In order to be able to help, however, I will need some code to debug and eventually refactor so that it works as expected.

    Can you open a new support ticket and send me your project so that I can try to solve the case for you?

    Thanks for your time.

    Regards,
    Deyan
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  6. Robert Lautenbach
    Robert Lautenbach avatar
    18 posts
    Member since:
    Dec 2009

    Posted 30 May 2013 Link to this post

    Deyan...I am unbale to send you the source but if you test with the telerik control examples under RadExpander and run the inbox example, its identical to what I am trying to do.   The one exception is that I want to be able to click on "Me" and have it call my custom event vs expand the expander.  I stil want the expander to work, just not whne you clck on "me".

    bob
  7. Robert Lautenbach
    Robert Lautenbach avatar
    18 posts
    Member since:
    Dec 2009

    Posted 30 May 2013 Link to this post

    Deyan...


    Here is what I have done to work around it.  Take a look at the PART_ButtonImage listed below...is this expected?

            private async void xPander_Tap(object sender, System.Windows.Input.GestureEventArgs e)
            {
                if (e.OriginalSource.GetType() == typeof(Image))
                {
       
                    Image ri = (Image)e.OriginalSource;
                    if (ri.Name == "PART_ButtonImage") ///This is strange as I have named the RadImage "friendImage" but I always get "PART_ButtoImage"
                    {
                        RadExpanderControl ctl = sender as RadExpanderControl;
                        ctl.IsExpanded = false;
                        BumpedN2.Models.BumpedN2Model.BumpedFriend item = (BumpedN2.Models.BumpedN2Model.BumpedFriend)ri.DataContext;
                        App.ViewModel.isTapBump = false;
                        if (item != null)
                        {
                            if (App.ConfirmAllBumps)
                            {
                                MessageBoxResult result = MessageBox.Show("BumpN2 " + item.Name + "?", "", MessageBoxButton.OKCancel);

                                if (result == MessageBoxResult.OK)
                                {
                                    await App.ViewModel.UpdateBumpCount(item.FacebookId);
                                }
                            }
                             else //await App.ViewModel.UpdateBumpCount(item.FacebookId);
                        }
                        BumpeFriendsList.SelectedItem = null;
                    }
                }
            }
  8. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 31 May 2013 Link to this post

    Hi Robert,

    Thanks for writing back.

    There should be a much more easier way to implement this behavior. Just make sure you set the Handled property of the tapped element within the Content of the Expander to true. For instance, I am handling here the Tap event of the TextBlock which displays the Sender in our Inbox example of RadExpanderControl:

    private void TextBlock_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    {
        e.Handled = true;
    }

    If I set the Handled property to true, the ExpanderControl will not expand since it will see that someone has already handled the Tap event.

    I hope this helps.

    Regards,
    Deyan
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  9. Robert Lautenbach
    Robert Lautenbach avatar
    18 posts
    Member since:
    Dec 2009

    Posted 31 May 2013 Link to this post

    Thanks!!
Back to Top
DevCraft banner