当前位置: 动力学知识库 > 问答 > 编程问答 >

silverlight - Finding in which column of a datagrid is a specific control

问题描述:

I got a datagrid on which I put a MouseButtonEventHandler.

Everytime I click on a row, my event is raised.

What I would like to do is handle that event only when the event was raised on a particular column.

I can get the control that raised the event via e.OriginalSource. But I don't known how I must do something like:

if(_dg.Column["TheRightColumn"].Contains(e.OriginalSource)) //Do the job

网友答案:

Is it possible to make the column a template column? If so place a control (maximised grid) in the template and handle your click event on that control, rather than the whole grid.

分享给朋友:
您可能感兴趣的文章:
随机阅读: