How to add a button to a compact framework DataGrid?

橙三吉。 提交于 2019-12-22 07:28:07

问题


Is it possible to add a button to a column in the DataGrid for the compact framework? So far the only thing I can find is you can add textbox and that's it. What would be a good alternative to a DataGrid that can allow other controls?


回答1:


You can use the DataGrid's

public Rectangle GetCellBounds(int row, int col);

with

public event EventHandler CurrentCellChanged;
public DataGridCell CurrentCell { get; set; }

or

public event MouseEventHandler MouseMove;
public HitTestInfo HitTest(int x, int y);

to show a Button (or another control) over the selected cell.

Regards, tamberg



来源:https://stackoverflow.com/questions/285111/how-to-add-a-button-to-a-compact-framework-datagrid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!