【发布时间】:2010-07-23 15:15:14
【问题描述】:
我正在使用DevExpress.XtraEditors.LookUpEdit 来显示有关可用课程的信息。目前它有3列。除非我将 editValue 设置为最后一行,否则查找编辑工作正常。当editvalue设置为除最后一行之外的任何行时,当lookupedit尚未打开时,它会显示选定的行,而lookupedit设置为最后一行则不显示任何内容。目前我是:
lookupedit.Properties.ForceInitialize() ' Force it to initialize
lookupedit.Properties.PopulateColumns() ' Force the lookupedit to populate
For i As Integer = 0 To tableData.Rows.Count - 1 ' Go through the information in it
If lblClassVal.Text = tableData.Rows(i).Item(1).ToString() Then ' if the current row is equal to the value I want to select
lookupedit.EditValue = i + 1 ' then I set the lookupedit value
End If
Next i
lookupedit.Properties.Columns("class_id").Visible = False ' set two columns to invisible
lookupedit.Properties.Columns("active").Visible = False
lookupedit.Properties.Columns("class_name").Caption = "Class Name" ' set the 3rd column to a better title
现在,lookupedit 显示选定的文本,除非我选择最后一行,行号tableData.Rows.Count,然后什么都不显示。然而,当我打印它们的值时它们是正确的,当我在设置查找编辑时删除+1 时,它会将其设置为上一行,我希望第一行无法显示。
【问题讨论】:
标签: vb.net devexpress