当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: 当文档处于大纲视图中时,如何给文档添加内容? ......
    摘要: 当我要进行制表时,如果先输入正文,在进行排版,在排版中就需要将正文转换为表格,请问我该如何处理? ......


请各位高手帮忙解决关于DataGrid控件的问题,,小弟将重分感谢

按照下面的想法,我应该如何做?  
   
  我想在点击DataGrid中的   (X行,Y列)   时,程序在(X行,Y列)的位置显示一个下拉列表框进行选择。  
   
  请各位高手帮忙解决这个问题,小弟将重分感谢!

NO.1   作者: ColderRain

动态创建一个弹出菜单,在x,y处弹出!

NO.2   作者: dzq138

说句实话,微软的GRID垃圾不如!你实现了也是白学,微软的工程师如果不是有意不加强GRID功能就是一班猪!几代的GRID都没有给我们一个好一点的希望。  
  不足之处就不一一数落,越想越气。  
  用两行显一条记录。  
  列标题文字居中。  
  多表头。  
  DoubleClick响应不如没有,还要自己写一堆代码,而且也不顺畅。  
  就算绑了菜单,右键出菜单竟是单元格的“复制”微软自带的GRID去死吧!!  
  。  
  ComponentOne   FlexGrid   For   .Net是可要实现这些的功能。可没有注册码!  
   
  private   ComboBox   comboControl;  
  private   DataGridTextBoxColumn   datagridtextBox;  
  datagridtextBox   =   (DataGridTextBoxColumn)datagrid1.TableStyles[0].GridColumnStyles[4];       //指明第几列!  
  datagridtextBox.TextBox.GotFocus +=   new   EventHandler(this.dgdFunctionArea_GotFocus);  
  private   void   dgdFunctionArea_GotFocus(object   o,   EventArgs   e)  
  {  
  comboControl   =   new   ComboBox();  
  comboControl.Cursor=   System.Windows.Forms.Cursors.Arrow;  
  comboControl.DropDownStyle =   System.Windows.Forms.ComboBoxStyle.DropDownList   ;  
  comboControl.Dock =   DockStyle.Fill   ;  
  comboControl.Items.AddRange(new   string[6]{"大老虎","可爱的龙","猪头","死老鼠","鸡婆","马"});  
  datagridtextBox.TextBox.Controls.Add(comboControl);  
  comboControl.Text   =datagrid1[datagrid1.CurrentCell.RowNumber,datagrid1.CurrentCell.ColumnNumber].ToString   ();//将GRID的值赋给下拉框。  
  comboControl.BringToFront();  
  comboControl.SelectedIndexChanged     +=new   EventHandler(this.comboControl_SelectedIndexChanged);//增加一事件,好让选择到的值能返回到GRID中。  
  }  
  //如何返回值就你自己在这里写了。  
  private   void   comboControl_SelectedIndexChanged(object   sender,   System.EventArgs   e)  
  { datagrid1[datagrid1.CurrentCell.RowNumber,datagrid1.CurrentCell.ColumnNumber]=comboControl.Text;     //将改变的值传回DATAGRID中.  
  }  
  试一试喽,祝你好运.


 ·我的virsual assist 有问题    »显示摘要«
    摘要: 我的vc是中文版的(不知有无关系)! 安装了virsual assist 后!打开*.dsw文件时,系统提示说:"*****"引用"****"内存不能read !!(*表示内存地址),之后按"确定"就关闲了vc! 我不知为什么?有高手帮下忙吗? ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE