如table数具列隐藏了,datalist不能显示此隐藏列,如何设置.
呵,也只有这个办法了,我只是说不明白为什么的问题.呵呵
明白了,绑定的是TABLE而不是DATATABLE.
[此贴子已经被作者于2009-5-18 13:56:54编辑过]
Datalist可以单独设置显示那些列啊。所以楼主的问题,是可以解决的:
Dim ColumnList As String
For each c as Col in Tables("某表").Cols
If c.Visible Then
ColumnList = ColumnList & c.Name & ","
End if
Next
Dim dst As WinForm.DataList = e.Form.Controls("DataList1")
dst.ColumnList= ColumnList.Trim(",")
dst.DataTable = DataTables("某表")
dst.Build()
[此贴子已经被作者于2009-5-18 15:28:37编辑过]
以下是引用狐狸爸爸在2009-5-18 15:27:00的发言:Datalist可以单独设置显示那些列啊。所以楼主的问题,是可以解决的:
Dim ColumnList As String
For each c as Col in Tables("某表").Cols
If c.Visible Then
ColumnList = ColumnList & c.Name & ","
End if
Next
Dim dst As WinForm.DataList = e.Form.Controls("DataList1")
dst.ColumnList= ColumnList.Trim(",")
dst.DataTable = DataTables("某表")
dst.Build()
[此贴子已经被作者于2009-5-18 15:28:37编辑过]
学习!
以下是引用狐狸爸爸在2009-5-18 15:27:00的发言:Datalist可以单独设置显示那些列啊。所以楼主的问题,是可以解决的:
Dim ColumnList As String
For each c as Col in Tables("某表").Cols
If c.Visible Then
ColumnList = ColumnList & c.Name & ","
End if
Next
Dim dst As WinForm.DataList = e.Form.Controls("DataList1")
dst.ColumnList= ColumnList.Trim(",")
dst.DataTable = DataTables("某表")
dst.Build()
[此贴子已经被作者于2009-5-18 15:28:37编辑过]
非常感谢.
以下是引用yangming在2009-5-18 16:26:00的发言:
4楼的代码还是不能显示已隐藏的列啊
老六提供的是思路!关键的完善得自己解决.
以下是引用狐狸爸爸在2009-5-18 16:29:00的发言:
那个代码是排除隐藏列
楼主要的是显示隐藏列的,呵呵