How to use the Dev Express Imagecomboboxedit,repositoryitemimagecombobox

Source: Internet
Author: User

How to use the Dev Express Imagecomboboxedit,repositoryitemimagecombobox

1. Using Imagecomboboxedit to implement the drop-down box key value data function

         Public Static voidINITCMB (Imagecomboboxedit CMB, DataTable Source,stringValuestringTextBOOLisdefaultnull) {imagecomboboxitem[] Items=NewImagecomboboxitem[source. Rows.Count +1]; inti =0; if(isdefaultnull) {items[i]=NewImagecomboboxitem (); Items[i]. Description=""; Items[i]. Value=""; Items[i]. ImageIndex= -1; I++; }            foreach(DataRow Drinchsource. Rows) {Items[i]=NewImagecomboboxitem (); Items[i]. Description=Dr[text].                ToString (); Items[i]. Value=Dr[value]; Items[i]. ImageIndex= -1; I++; } CMB.            Properties.Items.Clear (); Cmb.                        Properties.Items.AddRange (Items); Cmb. EditValue= items[0].        Value; }

2. Using Repositoryitemimagecombobox to implement Gridcontrol content in-cell drop-down key value data function

         Public Static voidINITCMB (Repositoryitemimagecombobox Repimagecombobox, DataTable source,stringValuestringTextBOOLisdefaultnull) {imagecomboboxitem[] Items=NewImagecomboboxitem[source. rows.count+1]; intI=0; if(isdefaultnull) {items[i]=NewImagecomboboxitem (); Items[i]. Description=""; Items[i]. Value=""; Items[i]. ImageIndex= -1; I++; }            foreach(DataRow Drinchsource. Rows) {Items[i]=NewImagecomboboxitem (); Items[i]. Description=Dr[text].                ToString (); Items[i]. Value=Dr[value]; Items[i]. ImageIndex= -1; I++;        } repImageComboBox.Items.AddRange (Items); }

3. Using Repositoryitemimagecombobox/imagecombobox and imagecollection to implement Gridcontrol content in-cell drop-down image data function

         Public Static voidINITIMGCMB (Repositoryitemimagecombobox Repimagecombobox, DataTable source,stringValueBOOLisdefaultnull) {imagecomboboxitem[] Items=NewImagecomboboxitem[source. Rows.Count +1]; inti =0; if(isdefaultnull) {items[i]=NewImagecomboboxitem (); Items[i]. Description=""; Items[i]. Value=""; Items[i]. ImageIndex= -1; I++; }            foreach(DataRow Drinchsource. Rows) {Items[i]=NewImagecomboboxitem (); Items[i]. Description=""; Items[i]. Value=Dr[value]; if(Int32.Parse (items[i). Value.tostring ()) = =0) {Items[i]. ImageIndex=0; }Else if(Int32.Parse (items[i). Value.tostring ()) = =1) {Items[i]. ImageIndex=1; }Else if(Int32.Parse (items[i). Value.tostring ()) = =2) {Items[i]. ImageIndex=2; }Else if(Int32.Parse (items[i). Value.tostring ()) = =3) {Items[i]. ImageIndex=3; }Else if(Int32.Parse (items[i). Value.tostring ()) = =4) {Items[i]. ImageIndex=4; } I++;        } repImageComboBox.Items.AddRange (Items); }

How to use the Dev Express Imagecomboboxedit,repositoryitemimagecombobox

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.