以下是引用cpayinyuan在2009-5-25 11:15:00的发言:
这样操作,是把DataList的行号切换成选择框了,还是在行号之外又增加了一个选择框?这个选择框和以前的那个通过RowHeaderVisible和CheckBoxes切换的行号/选择框有什么关系,还是请贺老师详细说明一下比较好!
贺老师让我们多试是为我们好,这一点我们表示感谢!但是,我们都不是专业的开发人员,平时工作也比较忙,能在帮助中说清楚的事情,还是希望能说清楚一点,看明白之后再试,可能效率会高一点!
商业版推出时,应该在帮助中说清楚的.但:
自己试验很难吗?『三尾狐』难道似『婴狐』般还需嗷嗷哺乳吗?
1.插入DataList1,绑定表A
2.Button1
Dim dst As WinForm.DataList = e.Form.Controls("DataList1")
dst.RowHeaderVisible = True
dst.CheckBoxes = True
dst.Build()
3.Button2
e.Form.Controls("DataList1").ToggleCheckBoxes()
4.Button3
Dim dst As WinForm.DataList = e.Form.Controls("DataList1")
For Index As Integer = 0 To dst.Count - 1
If dst.GetChecked(Index) Then
Dim dr As DataRow = dst.GetDataRow(Index)
dr("第一列") = 0.05
End If
Next
5.Button4
Dim dst As WinForm.DataList = e.Form.Controls("DataList1")
For Index As Integer = 0 To dst.Count - 1
dst.SetChecked(Index, True)
Next