using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Dongke.IBOSS.PRD.Basics.BaseControls; namespace Dongke.IBOSS.PRD.BaseControlsTest { public partial class Form1 : FormBase { DataTable dt = new DataTable(); public Form1() { InitializeComponent(); dt.Columns.Add("id", typeof(int)); dt.Columns.Add("name", typeof(string)); object o = 1; bool b = 1.Equals(o); for (int i = 1; i < 50; i++ ) { dt.Rows.Add(new object[] { i, "N" + i }); } //this.dkListBoxComboBox1.DataSource = dt; //this.dkListBoxComboBox1.DisplayMember = "name"; //this.dkListBoxComboBox1.ValueMember = "id"; //this.dkCheckedListBoxComboBox1.DataSource = dt; //this.dkCheckedListBoxComboBox1.DisplayMember = "name"; //this.dkCheckedListBoxComboBox1.ValueMember = "id"; ////this.dkCheckBoxComboBox1.DataSource = dt; ////this.dkCheckBoxComboBox1.DisplayMember = "name"; ////this.dkCheckBoxComboBox1.ValueMember = "id"; //comboBox1.DataSource = dt; //this.comboBox1.DisplayMember = "name"; //this.comboBox1.ValueMember = "id"; ////this.dkListBoxComboBoxEx1.tt = textBox1; ////this.dkListBoxComboBoxEx1.DataSource = dt; ////this.dkListBoxComboBoxEx1.DisplayMember = "name"; ////this.dkListBoxComboBoxEx1.ValueMember = "id"; //this.Column1.DataPropertyName = "id"; //this.Column1.DataSource = dt; //this.Column1.DisplayMember = "name"; //this.Column1.ValueMember = "id"; //DataTable dd = new DataTable(); //dd.Columns.Add("id", typeof(int)); //dd.Columns.Add("c2", typeof(int)); //this.c_DataGridView1.DataSource = dd; //checkedListBox1.CheckOnClick = true; //this.checkedListBox1.DataSource = dt; //this.checkedListBox1.DisplayMember = "name"; //this.checkedListBox1.ValueMember = "id"; //this.listBox1.DataSource = dt; //this.listBox1.DisplayMember = "name"; //this.listBox1.ValueMember = "id"; this.dataGridView1.DataSource = dt; } private void dataGridView1_RowEnter(object sender, DataGridViewCellEventArgs e) { //e. object d = dataGridView1.Rows[e.RowIndex].Cells["id"].Value; } } }