Ejemplo n.º 1
0
        private void BindDataTable(ImageComboBoxEdit cmb, DataTable dtSource, string display, string valueMember)
        {
            if (dtSource == null)
            {
                return;
            }
            cmb.Properties.Items.Clear();
            DevExpress.XtraEditors.Controls.ImageComboBoxItem itemtemp = new DevExpress.XtraEditors.Controls.ImageComboBoxItem();
            itemtemp.Value       = null;
            itemtemp.Description = "请选择....";
            cmb.Properties.Items.Add(itemtemp);

            for (int i = 0; i < dtSource.Rows.Count; i++)
            {
                DevExpress.XtraEditors.Controls.ImageComboBoxItem itemtemp1 = new DevExpress.XtraEditors.Controls.ImageComboBoxItem();

                itemtemp1.Value       = dtSource.Rows[i][valueMember];
                itemtemp1.Description = dtSource.Rows[i][display].ToString();
                cmb.Properties.Items.Add(itemtemp1);
            }
            if (dtSource.Rows.Count > 0)
            {
                cmb.SelectedIndex = 0;
            }
            else
            {
                cmb.SelectedIndex = -1;
            }
        }
Ejemplo n.º 2
0
 public static void PopulateMarkerImageComboBox(DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox imageBox)
 {
     RetrieveMarkerImages();
     imageBox.Items.Clear();
     imageBox.SmallImages = markerImageList;
     imageBox.LargeImages = markerImageList;
     //Add null item
     imageBox.Items.Add(new DevExpress.XtraEditors.Controls.ImageComboBoxItem("N/A", null, -1));
     foreach (var dr in markerImagesTable)
     {
         DevExpress.XtraEditors.Controls.ImageComboBoxItem item =
             new DevExpress.XtraEditors.Controls.ImageComboBoxItem(dr.SymbolTitle, dr.SymbolValue, dr.SymbolValue - 1);
         imageBox.Items.Add(item);
     }
 }
Ejemplo n.º 3
0
 //
 public static void InitializaImage(
     ref System.Windows.Forms.ImageList imageListBrxb,
     ref DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox repItemImageComboBoxBrxb)
 {
     try
     {
         imageListBrxb = ImageHelper.GetImageListBrxb();
         repItemImageComboBoxBrxb.SmallImages = imageListBrxb;
         DevExpress.XtraEditors.Controls.ImageComboBoxItem ImageComboItemMale   = new DevExpress.XtraEditors.Controls.ImageComboBoxItem("男", "1", 1);
         DevExpress.XtraEditors.Controls.ImageComboBoxItem ImageComboItemFemale = new DevExpress.XtraEditors.Controls.ImageComboBoxItem("女", "2", 0);
         repItemImageComboBoxBrxb.Items.Add(ImageComboItemMale);
         repItemImageComboBoxBrxb.Items.Add(ImageComboItemFemale);
     }
     catch (Exception)
     {
         throw;
     }
 }
        public static void PopulateMarkerImageComboBox(DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox imageBox)
        {
            RetrieveMarkerImages();
            imageBox.Items.Clear();
            imageBox.SmallImages = markerImageList;
            imageBox.LargeImages = markerImageList;
            int indx     = 0;
            int imgIndex = -1;

            //Add null item
            imageBox.Items.Add(new DevExpress.XtraEditors.Controls.ImageComboBoxItem("N/A", null, -1));
            foreach (var img in markerImageList.Images)
            {
                indx     += 10;
                imgIndex += 1;
                DevExpress.XtraEditors.Controls.ImageComboBoxItem item =
                    new DevExpress.XtraEditors.Controls.ImageComboBoxItem($"Icon{indx}", indx, imgIndex);
                imageBox.Items.Add(item);
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 在SampleLayerCombox的Tag中存放combobox选择项的栅格数据,方便直接调用
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void LayerCombox_SelectedIndexChanged(object sender, EventArgs e)
 {
     DevExpress.XtraEditors.Controls.ImageComboBoxItem tt = (DevExpress.XtraEditors.Controls.ImageComboBoxItem)(sender as ImageComboBoxEdit).SelectedItem;
     SampleLayerCombox.Tag = tt.Value;
 }
Ejemplo n.º 6
0
 private void LoadLangType()
 {
     string[] langTypes = ConnectSetting.GetAppConfig("LangType", false).Split(new string[] { ",", "|" }, StringSplitOptions.RemoveEmptyEntries);
     for (int i = 0; i < langTypes.Length; i++)
     {
         DevExpress.XtraEditors.Controls.ImageComboBoxItem item=new DevExpress.XtraEditors.Controls.ImageComboBoxItem();
         item.Description = langTypes[i];
         item.Value = langTypes[i + 1];
         cbxLang.Properties.Items.Add(item);
         i++;
     }
 }