[VB.NET]利用vb.net创建一个完全可编辑的DataGrid,从而实现操作Access数据库进行增,删,改的功能,前提是不用任何其他的Button

VB.NET源码-156个实用实例哦…… 利用vb.net创建一个完全可编辑的DataGrid,从而实现操作Access数据库进行增,删,改的功能,前提是不用任何其他的Button
利用vb.net创建一个完全可编辑的DataGrid,从而实现操作Access数据库进行增,删,改的功能,前提是不用任何其他的Button
__________________________________________________________________________
如果您知道可以用Button时是怎么写的应该也可以知道不用时怎么写吧?
__________________________________________________________________________
呵呵,我还没试过,我只是用一个右键menu实现,还没试过没有其他东西
__________________________________________________________________________
晕倒~~
__________________________________________________________________________
二楼说的对!
__________________________________________________________________________
晕倒?何解?
__________________________________________________________________________
可以试试在DATAGrid中写事件
__________________________________________________________________________
2005

拉过去 就有了

一行代码也不用写
__________________________________________________________________________
给你个例子吧
dt类别= obj类别.Search类别(-1, " ").Tables[0];

DataGridTableStyle tableStyle = new DataGridTableStyle();

DataGridTextBoxColumn columnStyle = new DataGridTextBoxColumn();
columnStyle.MappingName = "类别ID ";
columnStyle.HeaderText = "类别ID ";
columnStyle.Width = 0;
columnStyle.ReadOnly = false;
tableStyle.GridColumnStyles.Add(columnStyle);

columnStyle = new DataGridTextBoxColumn();
columnStyle.MappingName = "类别名称 ";
columnStyle.HeaderText = "类别名称 ";
columnStyle.Width = 80;
columnStyle.ReadOnly = false;
tableStyle.GridColumnStyles.Add(columnStyle);

columnStyle = new DataGridTextBoxColumn();
columnStyle.MappingName = "说明 ";
columnStyle.HeaderText = "说明 ";
columnStyle.Width = 80;
columnStyle.ReadOnly = false;
tableStyle.GridColumnStyles.Add(columnStyle);

columnStyle = new DataGridTextBoxColumn();
columnStyle.MappingName = "图片 ";
columnStyle.HeaderText = "图片 ";
columnStyle.Width = 80;
columnStyle.ReadOnly = false;
tableStyle.GridColumnStyles.Add(columnStyle);

tableStyle.RowHeadersVisible =true;
tableStyle.MappingName = "类别 ";
dtg类别.TableStyles.Add(tableStyle);

dt类别.DefaultView.AllowNew = false;
dt类别.DefaultView.AllowEdit = false;
dt类别.DefaultView.AllowDelete = false;
dtg类别.DataSource =dt类别.DefaultView;
obj类别.Dispose();
__________________________________________________________________________
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值