You can find on the link below some approaches that you can use to place DropDown in an UltraGrid cell:
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=7841
Returning to your current code snippet - you are almost there:
First you need to set the binding context of your UltraCombo to the BindingContext of the form in which your UltraCombo will be used, for example:
ultraComboPaneel.BindingContext = this.BindingContext;
Note that setting a binging context must occur before your control is in ControlControl. Another thing I noticed is that the property is currently changing to EditorComponent, so I believe that you are using an older version of the Infragistics components. However, you should still use the same approach. I created a small piece of code that shows above with code:
public partial class Form1 : Form { UltraCombo uc; public Form1() { InitializeComponent(); DataTable dt = new DataTable(); dt.Columns.Add("Int", typeof(int)); dt.Rows.Add(1); dt.Rows.Add(1); dt.Rows.Add(1); DataTable dtt = new DataTable(); dtt.Columns.Add("Int", typeof(int)); dtt.Rows.Add(2); dtt.Rows.Add(2); dtt.Rows.Add(2); uc = new UltraCombo(); uc.BindingContext = this.BindingContext; uc.DataSource = dtt; ultraGrid1.DataSource = dt.DefaultView; } private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.Bands[0].Columns[0].EditorComponent = uc; } }
Hope this helps.
source share