开发者

vb datagridview columntype change on edit

is there a method of setting up my datagridview to show me textboxcolumns until editmode is entered? At which time I will swap some textboxcolumns for bound comboboxcolumns. And at the end of validation/exit edit mode I can swap back?

If there's a method of doing this pl开发者_运维问答ease share some links to examples.


I wouldn't try to switch DataGridView ColumnTypes like that. Sounds like a bad time.

Is your goal to have a DataGridViewComboBoxColumn that does not display the ComboBox dropdown button when it's not being edited? If so, there are two options:

  1. Set the column's DataGridViewComboBoxColumn.DisplayStyleForCurrentCellOnly property to True.

  2. Create your own DGV column based on the ComboBox by extending DataGridViewTextBoxCell. MSDN has a great article for doing this with the Calendar control here.


Of course you can. In the properties of the datagridview you can drill down to the column proprieties and switch the datatype to combo box. Very straight forward and easy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜