Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 938995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:43:12+00:00 2026-05-15T21:43:12+00:00

I am using DevExpress.XtraEditors.LookUpEdit to display the information about the classes available. Currently it

  • 0

I am using DevExpress.XtraEditors.LookUpEdit to display the information about the classes available. Currently it has 3 columns. The lookupedit is working perfectly except when I set the editValue to the last row. When the editvalue is set to any row other than the last one it shows the selected row when the lookupedit isn’t opened yet when the lookupedit is set to the last row nothing is displayed. Currently I am :

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

Right now the lookupedit displays the selected text unless I select the last row, row number tableData.Rows.Count which then displays nothing. Yet when I print the values they are correct and when I remove the +1 when setting the lookupedit it sets it to the previous line I want an the first row can’t be displayed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:43:12+00:00Added an answer on May 15, 2026 at 9:43 pm

    Ok I solved this. Just in case someone else if having this problem I will leave the question up.

    So the DevExpress LookUpEdit doesn’t use the row number, it uses the ID column in your LookUpEdit table. So instead of selecting this by the row number set the EditValue to the ID number of the row you want to select. So instead of:

    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
    

    Use :

    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
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using DevExpress GridControl to display information from my database through a stored
Hai all, Am using DevExpress LookupEdit in C#.NET project,also set both Display Member and
I am currently using DevExpress 10.2 within Visual Studio 2010. In a previous question
I am currently using DevExpress 11.2 within Visual Studio 2010. Currently I am using
I've been using DevExpress's free refactoring tool for about 6 months now (love it!).
I'm using DevExpress LookUpEdit control in my application. I want to set the datasource
I am using a DevExpress TdxMemData in memory TDataSet descendant. While it has Filtered:
Scenario I am using the latest version of DevExpress XtraGrid. I am currently binding
I am using devexpress asp:GridView in asp.net with two columns: status and percentage The
I am currently programming in Visual Studio 2010 within VB.NET and am using DevExpress

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.