Windows Mobile如何添加新列以删除Datagrid的行 [英] How to add a new column to delete a Datagrid's row, Windows mobile
问题描述
我正在使用 C#
( visual studio 2008
)和 sql server 2008
我使用选择"来显示 DataGrid
中的列:
I use a "select" to display columns in a DataGrid
:
SqlCeDataAdapter da = new SqlCeDataAdapter("SELECT * FROM DATOST", conn);
da.Fill(ds, "DATOST");
dtgLista.DataSource = ds.Tables[0].DefaultView;
,它显示类似于此
我想要做的是用单词 remove
添加一个新列,并在选择该列时删除该行.
What I'm trying to do is to add a new column with the word remove
and when it be selected delete the row.
我尝试使用此
---和更多我无法写的链接,因为我至少需要10个信誉才能发布2个以上的链接---
--- and more links I can't write because i need at least 10 reputation to post more than 2 links---
但是我的应用无法正常工作
But My app doesn´t work
请问有更简单的主意吗?
谢谢
推荐答案
Compact Framework(在Windows Mobile上运行的.net运行时)不支持按钮或数据网格中的其他元素.默认情况下,仅支持EditBox.
Compact Framework, which the .net runtime running on Windows Mobile, does not support button or other elements within a datagrid. Only EditBox is supported by default.
在stackoverflow上,已经有关于如何向紧凑型框架数据网格中添加按钮或复选框的问题和答案:
There are already questions and answers on how to add a button or checkBox to a compact framework datagrid here at stackoverflow:
将按钮附加到C#Compact Framework .Net 2.0中的列datagrid
和
和其他方面,例如:解决方案是为数据单元添加一个自定义绘制处理程序.
The solution is to add a custom paint handler for datacells.
还有一些商业扩展的数据网格控件,它们不仅仅支持EditBox:例如Resco SmartDrid控件:
There are also commercial extended datagrid controls available that support more than only EditBox: for example Resco SmartDrid control: article at codeproject. I am sure there are other vendors too. Just use a internet search "compact framework datagrid add button".
这篇关于Windows Mobile如何添加新列以删除Datagrid的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!