Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
AI Productivity Tools
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
You may verify the type of the original source:
private void clubsGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
var originalSource = e.OriginalSource as FrameworkElement;
if (originalSource is TextBlock)
MessageBox.Show("The original source is TextBlock");
}
else if (originalSource is Border)
MessageBox.Show("The original source is Border");
else
MessageBox.Show("The original source is: " + e.OriginalSource);
You may use the ParentOfType<T> extension method and verify whether it is a GridViewCell or not:
private void playersGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
if (originalSource is Border)
if ((originalSource as Border).ParentOfType<
GridViewCell
>() != null)
MessageBox.Show("You have clicked on a Border of a GridViewCell");