DevExpress.XtraEditors.LookUpEdit
을 사용하여 사용 가능한 클래스에 대한 정보를 표시합니다. 현재 3 개의 열이 있습니다. lookupedit은 editValue를 마지막 행으로 설정하는 경우를 제외하고는 완벽하게 작동합니다. editvalue가 마지막 행 이외의 행으로 설정되면 조회 편집이 열리지 않을 때 선택된 행을 표시하지만 조회가 마지막 행으로 설정된 경우에는 아무 것도 표시되지 않습니다. 현재 나는 : 다음 아무것도 표시되지 않습니다 마지막 행, 행 번호 tableData.Rows.Count
를 선택하지 않으면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 선택한 텍스트를 표시합니다. 그러나 정확한 값을 인쇄 할 때 lookupedit을 설정할 때 +1
을 제거하면 이전 행으로 설정하고 첫 행을 표시 할 수 없습니다.