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 3280704
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:44:04+00:00 2026-05-17T19:44:04+00:00

I am using a DevExpress LookUpEdit control. My database has two tables that control

  • 0

I am using a DevExpress LookUpEdit control. My database has two tables that control the population of control options. One called MaintCategory and one called MaintItem. This introduces a Magic Number into my program(the CategoryID) but allows for lots of runtime customization.

My problem lies in how to allow my users to un-select a dropdown WITHOUT me having to add an “Empty” Item for every CategoryID. Isn’t there a way to inject a blank row? At the control level or when I construct the DataTable to return?

This is the DAL method that I use to populate all control choices.

public static DataTable GetMaintItems(int iCat)
    {
        using (var context = CmoDataContext.Create())
        {
            IQueryable<tblAdminMaintItem> tItems = context.GetTable<tblAdminMaintItem>();

            return (tItems.Where(item => item.CategoryID == iCat & item.Active == true).OrderBy(item => item.OrderID).Select(
                item => new { item.ItemID, item.ItemDescription })).CopyLinqToDataTable();
        }
    }
  • 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-17T19:44:04+00:00Added an answer on May 17, 2026 at 7:44 pm

    I actually ran into a very similar issue in an app I was working on recently using DevExpress’s LookUpEdit control — the inability to revert the control to having no selection once a selection has been made.

    My workaround was:

    1. Set the LookUpEdit.Properties.AllowNullInput property to true.
    2. Add an event handler to the LookUpEdit.Validating event.
    3. In that event handler, check for a blank string as the Text property and set EditValue to null manually.

    In other words, something like this:

    void m_lookUpEdit_Properties_Validating(object sender, CancelEventArgs e)
    {
        if (string.IsNullOrEmpty(m_lookUpEdit.Text))
        {
            m_lookUpEdit.EditValue = null;
        }
    }
    

    This allows the user to clear the text in the control, and have this effectively reset its value to null.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the DevExpress LookupEdit control in my C# application. How do I remove
I am using DevExpress.XtraEditors.LookUpEdit to display the information about the classes available. Currently it
I am using DevExpress OrgChart component that is still maintained but not developed since
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
Hai, Am using DevExpress LookupEdit in C#.NET application.I want to clear all items in
Hi all, I'm using DevExpress XtraGrid control in a C#.Net application. I'mbinding the values
I have a query in Delphi using DBExpress TSQLQuery that looks like so ActiveSQL.sql.add('SELECT
I need to create a Firebird Database programmatically using DBExpress. I have done this
Using online interfaces to a version control system is a nice way to have

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.