DataGridView编辑控件单独展开 [英] DataGridView Editing Control expand individually

查看:173
本文介绍了DataGridView编辑控件单独展开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使您的编辑控件扩展到拥有行的高度,并影响行的高度和其他单元格的高度。穿过它下方的细胞。有某种溢出。

How to make your editing control expand beyond height of the owning row with out affecting the row's height and other cell's height. To go over the cells below it. To have some kind of overflow.

请看图片。我希望编辑控件的行为像这样。

Please see the picture. I want editing control to behave like this.

推荐答案

您可以使用 ToolStripControlHost类以模拟你想要的。

You can use ToolStripControlHost class to "simulate" what you want.

在CellBeginEdit中,您可以:

On CellBeginEdit you can:


  1. 使用所需的控件创建一个面板一个多行文本框)

  2. 创建一个工具条控制主页,然后将您的面板添加到

  3. 将您的 ToolStripControlHost 添加到ToolStripDropDown

  4. 显示您所选择的 ToolStripDropDown 单元格

  1. create a Panel with the desired controls (i.e.: a multiline TextBox)
  2. create a ToolStripControlHost and add your Panel to it
  3. add your ToolStripControlHost to a ToolStripDropDown
  4. show your ToolStripDropDown over the selected cell

一些建议:


  • 使用关闭您的 CellEndEdit 上的 ToolStripDropDown ,然后单击表单中的 ToolStripDropDown
  • 移动/调整大小
  • 使用 GetCellDisplayRectangle 以获取代表所选单元格的显示区域的矩形

  • use a single ToolStripDropDown
  • close your ToolStripDropDown on CellEndEdit and form Move/Resize
  • use GetCellDisplayRectangle to obtain the rectangle that represents the display area for the selected cell

这篇关于DataGridView编辑控件单独展开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆