其他分享
首页 > 其他分享> > 在datagrid列中添加下拉列表//笔记、非原创

在datagrid列中添加下拉列表//笔记、非原创

作者:互联网

//笔记、非原创
private void AddGrdComBox()//在datagrid列中添加下拉列表
  {
   DataGridTextBoxColumn dgtb = (DataGridTextBoxColumn)grd_please.TableStyles[0].GridColumnStyles[8]; //8是列的序号

   ComboBox cmbFunctionArea = new ComboBox();

   cmbFunctionArea.Items.AddRange(new object[]{"正本","副本","原稿"});

   cmbFunctionArea.Cursor = Cursors.Arrow;

   cmbFunctionArea.DropDownStyle= ComboBoxStyle.DropDownList;

   cmbFunctionArea.Dock = DockStyle.Fill;

   cmbFunctionArea.SelectionChangeCommitted += new EventHandler(cmbFunctionArea_SelectionChangeCommitted);

   dgtb.TextBox.Controls.Add(cmbFunctionArea);            


  }

原文链接:https://blog.csdn.net/csdnatm/article/details/141760

标签:cmbFunctionArea,ComboBox,列中,列表,datagrid,SelectionChangeCommitted,new
来源: https://www.cnblogs.com/841019rossi/p/14829502.html