0
我正在使用DevExpress.XtraEditors.LookUpEdit
來顯示有關可用類的信息。目前它有3列。除了當我將editValue設置爲最後一行時,lookupedit工作正常。如果editvalue被設置爲除最後一行以外的任何行,則當lookupedit設置爲最後一行時不顯示任何內容,則當lookupedit未打開時顯示所選行。目前我:Devexpress 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
然後什麼也不顯示。然而,當我打印這些值時,它們是正確的,當設置lookupedit時刪除+1
時,它將它設置爲上一行,我希望第一行無法顯示。