Skip to main content
A newer version of this page is available. .

How to: Create Lookup Editor and Bind It to Data Source

  • 7 minutes to read

This example shows how to use an in-place LookUpEdit control (RepositoryItemLookUpEdit) to edit cells in a grid column.

The lookup editor is assigned to the CategoryID column. The editor displays category names in the edit box instead of category IDs (see the DisplayMember setting).

lookup-standardmode-example-result.gif

View Example

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LookupEdit_StandardBinding {
    static class Program {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main() {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}