我们平时在桌面上单击就会出现一个选择框,但怎么样才能在datagrid上面实现啊
各位大哥帮帮忙啊

解决方案 »

  1.   

    拖放一个ContextMenu控件,然后在DataGrid属性中选择下就可以了
      

  2.   

    没搞过,试试在IDE里找属性,有没有这项可以设置一下的
      

  3.   

    1、在private void InitializeComponent()中注册
    this.datagridname.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.datagridfunction);
    2、制作C#函数
    private void datagridfunction(object sender, system.Web.UI.WebControls.DataGridItemEventArgs e)
    {
    if ( e.Item.ItemIndex != -1 )
    {
    e.Item.Attributes.Add( "onClick","script_function(this,'p','...');" ); }
    }
    3、制作java script函数
    function script_function( obj,p,p2 )
    {
     //单击事件
    }