DevExpress control library ---- SearchLookUpEdit control, devexpress paging Control

Source: Internet
Author: User

DevExpress control library ---- SearchLookUpEdit control, devexpress paging Control

DevExpress control library ---- SearchLookUpEdit Control

 

Basic data:

 

Public class Product {public int Id {get; set;} public string Model {get; set;} public string Name {get; set ;}} public class Entility {private static string GetChar (int number) {string [] array = new string [] {"A", "B", "C", "D ", "E", "F", "G", "H", "I"}; string result = array [number % 9]; return result ;} private static string GetName (int number) {string [] array = {"Unitch Data Collector", "MS scanner", "105SL", "TSC", "PH880 ", "MS320 portable printer", "PA700", "DSX800 computer", "HP printer"}; string result = array [number % 9]; return result ;} public static List <Product> GetProductList () {List <Product> list = new List <Product> (); for (int I = 0; I <200; I ++) {Product product = new Product () {Id = 100 + I, Model = GetChar (I) + I. toString () + "DLJ", Name = GetName (I) + I. toString ()}; list. add (product) ;}return list;} public static DataTable GetDataTable () {DataTable dt = new DataTable (); dt. columns. add ("Id", typeof (System. int32); dt. columns. add ("Model", typeof (System. string); dt. columns. add ("Name", typeof (System. string); for (int I = 0; I <200; I ++) {DataRow dr = dt. newRow (); dr ["Id"] = 100 + I; dr ["Model"] = GetChar (I) + I. toString () + "DLJ"; dr ["Name"] = GetName (I) + I. toString (); dt. rows. add (dr) ;}return dt ;}}

 

 

 

I. Use the SearchLookUpEdit control: whether the control is tall or not.

Bind data and add row number indexes before

   private void Form3_Load(object sender, EventArgs e)        {            List<Product> list = Entility.GetProductList();            searchLookUpEdit1.Properties.DataSource = list;        }        private void searchLookUpEdit1View_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)        {            if (e.RowHandle >= 0 && e.Info.IsRowIndicator)            {                e.Info.DisplayText = (e.RowHandle + 1).ToString();            }        }

Add data columns:

Simple attributes:

// Double-click the searchLookUpEdit1.Properties drop-down list. showDropDown = ShowDropDown. doubleClick; searchLookUpEdit1.Properties. immediatePopup = true; // The searchLookUpEdit1.Properties drop-down list is displayed. textEditStyle = TextEditStyles. disableTextEditor; // This control does not allow the input of searchLookUpEdit1.Properties. nullText = ""; // clear the default value

This control has other functions. You are welcome to point it out !!

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.