C # Control (v): Combobox

Source: Internet
Author: User

drop-down list

Property:

Behavior:

DrawMode

Dropdownheight

DropDownWidth

IntegralHeight

ItemHeight

MaxDropDownItems

MaxLength

Sorted

Data:

DataSource

DisplayMember

Items

ValueMember

Miscellaneous:

AutoCompleteCustomSource

AutoCompleteMode

AutoCompleteSource

FormatString

Formattingenabled

Event:

DropDown

Dropdownclosed

Dropdownstylechanged

MeasureItem

SelectionChangeCommitted

Textupdate

Add Item:

1 Private void Dobinddata () 2         {3for              (int05; i++)4             {5                 1); 6             }7         }
View Code

To add a data source:

1  Private voidDobinddatasource ()2         {3             //construct a data source (or query from a database)4DataTable ADt =NewDataTable ();5DataColumn ADC1 =NewDataColumn ("f_id",typeof(int));6DataColumn ADC2 =NewDataColumn ("F_name",typeof(string));7 ADt.Columns.Add (ADC1);8 ADt.Columns.Add (ADC2);9              for(inti =0; I <3; i++)Ten             { OneDataRow ADR =Adt.newrow (); Aadr[0] = i+1; -adr[1] ="name_"+ (i+1); - ADt.Rows.Add (ADR); the             } -             //to bind -Combobox1.displaymember ="F_name";//the column name that the control displays -Combobox1.valuemember ="f_id";//column name of the control value +Combobox1.datasource =ADt; -}
View Code

C # Control (v): Combobox

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.