为什么datagrid控件不象dbgrid控件一样可以更改数据呢?有哪位大狭告诉我怎么实现在datagrid控件中修改数据???
能输入数据
首先得设置数据源
set datagrid1.datasource=Rs
然后将属性设置为允许添加和删除
把datagrid的addnew属性改成true
用ado的话
把下面的代码加进去
cnn.cursorlocation=aduseclient
cnn是adodb.connection
dim rs as new recordset
rs.open
set datagrid1.datasource =rs
datagrid1.allowaddnew =true
datagrid1.allowdelete =true
对了,还要给RS添加字段:
rs.fields.append ...
...
属性设置为允许添加修改
this is a save sub
Pub_rs.Update
Pub_rs.UpdateBatch