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

MouseLeftButtonDown event Problem with radtileview

1 Answer 86 Views
TileView
This is a migrated thread and some comments may be shown as answers.
javier
Top achievements
Rank 1
javier asked on 15 Apr 2011, 07:29 PM
Hi,
I have a grid that contains in one row a RadTileView control. i set a MouseLeftButtonDown event to the grid but when i make a click in the tileview area it does not shoot. Then i put the same event in the RadTileView control but did not work neither.
When i put the event on the tleviewItem it works correctly but what i need is to start this event when somebody click in an empty area.
Any solutions to this?
Sry for my english.
Greetings.

1 Answer, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 19 Apr 2011, 04:13 PM
Hi javier,

 The problem is that the RadTileView handles the MouseLeftButtonDown event. If you want to be able to handle it too you'll have to add a handler for it in code behind like this:

this.AddHandler(MouseLeftButtonDownEvent, new MouseButtonEventHandler(OnClick), true);
And in the OnClick method you can check if the click was inside some of the RadTileViewItems by checking if the original source has a parent of type RadTileViewItem like this:
private void OnClick(object sender, MouseButtonEventArgs e)
{
    var originalSource = e.OriginalSource as FrameworkElement;
    this.click.Text = (originalSource.ParentOfType<RadTileViewItem>() == null).ToString();
}
I've attached a sample project with this behavior and if you need further assistance feel free to ask.


All the best,
Zarko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TileView
Asked by
javier
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Share this question
or