本文介绍了Silverlight Datagrid 选择右键单击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
限时送ChatGPT账号..有没有办法让右键单击事件在工具包数据网格中选择一行?
Is there a way for a right click event to select a row in toolkit datagrid?
我正在使用运行良好的工具包上下文菜单,但问题是,只有左键单击才能选择行,如果我希望上下文菜单正常工作,我需要右键单击才能执行此操作.
I'm using toolkit context menu which works nicely, but the problem is, only left click is able to select rows, and I need right click to be able to do that if I want my context menu to work properly.
感谢任何帮助
推荐答案
您可以找到解决方案 此处.
You can find a solution here.
基本上是这样的:
private void dg_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.MouseRightButtonDown += new MouseButtonEventHandler(Row_MouseRightButtonDown);
}
void Row_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
dg.SelectedItem = ((sender) as DataGridRow).DataContext;
}
这篇关于Silverlight Datagrid 选择右键单击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论