As you know, in windows C#\'s gridview, if we want to handle a click/double click event on cell then there are events like CellClick, CellDoubleClick, etc.
So, i wan
An alternative way would to be define a DataGridTemplateColumn
instead of using the predefined columns like DataGridCheckBoxColumn
, DataGridComboBoxColumn
and then add an event handler to the UI element defined in the data template.
Below I have defined a MouseDown
event handler for a TextBlock
Cell.
In the Code behind file:
private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
{
TextBlock block = sender as TextBlock;
if (block != null)
{
// Some Logic
// block.Text
}
}