Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4165
UltraComboEditor as cell Editor Componenet not showing values
posted

Howdy,

 

I have a grid on a form. I have a combo editor which is variable on the form. I create the instance of the editor in the constructor, set a datasource of the combo editor to a generic list of 3 items, set the value and display members, populate the grid from a SQL procedure then set the EditorComponent of that sell in the init event of the grid.

 

I get a dropdown in each cell, but no values. I see the datasource of the combo editor has 3 items. Why don't I see any items?

 

private void ugContractorDoc_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)

        {

  e.Layout.Bands[0].Columns[docTemplateID"].EditorComponent = ucmboTemplates;

  e.Layout.Bands[0].Columns["docTemplateID"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;

        }

//from the constructor

 ucmboTemplates = new Infragistics.Win.UltraWinEditors.UltraComboEditor();            

 ucmboTemplates.DataSource = Document.Template.Controller.ReportTemplateController.GetReportTemplate(tm, false, true);                        

ucmboTemplates.DisplayMember = "ReportTemplateName";            

 ucmboTemplates.ValueMember = "ReportTemplateID";

 //fill data grid next

 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi,

    If you created the UltraComboEditor in code and set it's DataSource, it will not be able to get any data, because it has no BindingSource. You have to either add the UltraComboEditor to the form, or else set it's BindingContext to the BindingContext of the form or a new BindingContext.

    I also recommend just adding it to the form's Controls collection - otherwise, it will never get disposed and could create a memory leak.

Children