以文本方式查看主题
- Foxtable(狐表) (http://foxtable.com/bbs/index.asp)
-- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2)
---- 窗口列表项目排除空值 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=5797)
|
-- 作者:wqc360
-- 发布时间:2010/1/16 9:28:00
-- 窗口列表项目排除空值
请DX帮我看看,窗口组合框列表项目怎么不能排除空置,我代码哪里有问题,谢谢。 Dim cmb As WinForm.ComboBox = e.form.Controls("精度") cmb.ComboList = DataTables("基础表").GetComboListString("精度","精度 = \'IsNot Nothing\'") Dim cmb3 As WinForm.ComboBox = e.form.Controls("装夹难度") cmb3.ComboList = DataTables("基础表").GetComboListString("装夹","装夹 = \'IsNot Nothing\'") Dim cmb1 As WinForm.ComboBox = e.form.Controls("钢性") cmb1.ComboList = DataTables("基础表").GetComboListString("钢性","钢性 = \'IsNot Nothing\'")
|
-- 作者:czy
-- 发布时间:2010/1/16 11:16:00
--
Is Not Null
|
-- 作者:wqc360
-- 发布时间:2010/1/16 13:15:00
--
还是不行我两种都试了: 第一种: Dim cmb As WinForm.ComboBox = e.form.Controls("精度") cmb.ComboList = DataTables("基础表").GetComboListString("精度","精度 = \'Is Not Null \'") Dim cmb3 As WinForm.ComboBox = e.form.Controls("装夹难度") cmb3.ComboList = DataTables("基础表").GetComboListString("装夹","装夹 = \'Is Not Null \'") Dim cmb1 As WinForm.ComboBox = e.form.Controls("钢性") cmb1.ComboList = DataTables("基础表").GetComboListString("钢性","钢性 = \'Is Not Null \'") 第二种: Dim cmb As WinForm.ComboBox = e.form.Controls("精度") cmb.ComboList = DataTables("基础表").GetComboListString("精度","精度 Is Not Null ") Dim cmb3 As WinForm.ComboBox = e.form.Controls("装夹难度") cmb3.ComboList = DataTables("基础表").GetComboListString("装夹","装夹 Is Not Null ") Dim cmb1 As WinForm.ComboBox = e.form.Controls("钢性") cmb1.ComboList = DataTables("基础表").GetComboListString("钢性","钢性 Is Not Null ")
|
-- 作者:czy
-- 发布时间:2010/1/16 13:46:00
--
你的问题有些让人摸不着头脑,GetComboListString本身就有排除空行功能的,怎么还会出现空值呢?
|
-- 作者:wqc360
-- 发布时间:2010/1/16 15:08:00
--
我这样也是过了,也是不行: Dim cmb As WinForm.ComboBox = e.form.Controls("精度") cmb.ComboList = DataTables("基础表").GetComboListString("精度") Dim cmb3 As WinForm.ComboBox = e.form.Controls("装夹难度") cmb3.ComboList = DataTables("基础表").GetComboListString("装夹 ") Dim cmb1 As WinForm.ComboBox = e.form.Controls("钢性") cmb1.ComboList = DataTables("基础表").GetComboListString("钢性")
|
-- 作者:czy
-- 发布时间:2010/1/16 15:16:00
--
你把结果图发上来看看。
|
-- 作者:yangming
-- 发布时间:2010/1/16 15:19:00
--
"精度 Is Not Null "
|
-- 作者:wqc360
-- 发布时间:2010/1/16 15:29:00
--
我是用5楼代码的结果,好像3个代码都会一样的结果,请看图片:
此主题相关图片如下:打开窗口时报错图片.bmp
此主题相关图片如下:点确定能打开窗口,请看精度下拉项目.bmp
|
-- 作者:czy
-- 发布时间:2010/1/16 15:46:00
--
如果设置正确,只能说你的来源列数据有问题。 选中精度列,排除重复内容看看结果怎么样?
|
-- 作者:wqc360
-- 发布时间:2010/1/16 15:55:00
--
精度列是字符型,结果一样的,在表中属性PrepareEdit事件中设置能正常使用,但我现在想做成窗口录入。 If e.IsFocusCell Then If e.Col.Name = "难度情况_精度" Then e.Col.Combolist = DataTables("基础表").GetComboListString("精度") End If If e.Col.Name = "难度情况_切削" Then e.Col.Combolist = DataTables("基础表").GetComboListString("切削") End If If e.Col.Name = "难度情况_装夹" Then e.Col.Combolist = DataTables("基础表").GetComboListString("装夹") End If If e.Col.Name = "难度情况_钢性" Then e.Col.Combolist = DataTables("基础表").GetComboListString("钢性") End If If e.Col.Name = "工序_班组" Then e.Col.Combolist = DataTables("基础表").GetComboListString("班组") End If If e.Col.Name = "工艺_工作中心组" Then e.Col.Combolist = DataTables("基础表").GetComboListString("工作中心组","[班组] = \'" & e.Row("工序_班组") & "\'") End If End If
|