假设你的DataGrid的名字为DataGrid1
新建contextMenu1
在DataGrid的contextMenu属性里面选择菜单contextMenu1
然后再contextMenu1的popup函数里面写内容
例:
private void contextMenu1_Popup(object sender, System.EventArgs e)
{
if(dataGrid1.CurrentRowIndex<0)
return;
int id = dataGrid1.CurrentRowIndex;
......
}
新建contextMenu1
在DataGrid的contextMenu属性里面选择菜单contextMenu1
然后再contextMenu1的popup函数里面写内容
例:
private void contextMenu1_Popup(object sender, System.EventArgs e)
{
if(dataGrid1.CurrentRowIndex<0)
return;
int id = dataGrid1.CurrentRowIndex;
......
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货