因此DevExpress LookUpEdit不使用行号,而是使用LookUpEdit表中的ID列。因此,不要按行号选择它,而是将EditValue设置为要选择的行的ID号。所以不是:
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
用途:
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 = tableData.Rows(i).Item(0).ToString() ' Where Item(0) is my ID number column
End If