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
15
how we can attach combobox to gridbox in epicor
posted

// **************************************************
// Custom code for UD01Form
// Created: 06-12-2023 17:12:37
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Ice.BO;
using Erp.BO;
using Ice.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;
using Infragistics.Win.UltraWinGrid;

public class Script
{
// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
// Begin Wizard Added Module Level Variables **
// private ComboBox cmbCodeDesc;
// private UltraGrid grdDetail;

private UltraDropDown ultraDropDown1;

// Add this line at the class level or within the appropriate scope


// Declare cmbCodeDesc at the class level

// End Wizard Added Module Level Variables **

// Add Custom Module Level Variables Here **

public void InitializeCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
// Begin Wizard Added Variable Initialization
// Inside the form's constructor or load event

// Add additional initialization logic if required

// End Wizard Added Variable Initialization

// Begin Wizard Added Custom Method Calls
this.btnRow.Click += new System.EventHandler(this.btnRow_Click);


// End Wizard Added Custom Method Calls
}

public void DestroyCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
// Begin Wizard Added Object Disposal
this.btnRow.Click -= new System.EventHandler(this.btnRow_Click);

// End Wizard Added Object Disposal

// Begin Custom Code Disposal

// End Custom Code Disposal

}

private void btnRow_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
}
private void grdValidShipTo_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
{
// ** Place Event Handling Code Here **
e.Layout.Bands[0].Columns["Int32 1"].ValueList = ultraDropDown1;
}
private void bindUltraDropDown()
{
DataTable dt = new DataTable();
dt.Columns.Add("CodeDesc", typeof(string));
dt.Columns.Add("CodeDesc", typeof(string));
dt.Rows.Add(new object[] {1, "A"});
dt.Rows.Add(new object[] {2, "B"});
dt.Rows.Add(new object[] {3, "C"});
dt.AcceptChanges();
UltraDropDown ultraDropDown1 = new UltraDropDown();
ultraDropDown1.SetDataBinding(dt, null);
ultraDropDown1.ValueMember = "CodeDesc";
ultraDropDown1.DisplayMember = "CodeDesc";

}

}

can you plz tell me how we can attach

Parents
  • 28945
    Verified Answer
    Offline posted

    Hello and thank you for contacting Infragistics. Do you have an Int32 1 column? It appears this is taken from one of our samples explained here:

    https://www.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/86296/ultradropdown-within-ultrawingrid-cell-via-designer

    private void Form1_Load(object sender, System.EventArgs e)
    {            
        this.BindUltraDropDown();
    }
    
    private void BindUltraDropDown()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("ID", typeof(int));
        dt.Columns.Add("DisplayText", typeof(string));
    
        dt.Rows.Add(new object[] {1, "A"});
        dt.Rows.Add(new object[] {2, "B"});
        dt.Rows.Add(new object[] {3, "C"});
        dt.AcceptChanges();
    
        this.ultraDropDown1.SetDataBinding(dt, null);
        this.ultraDropDown1.ValueMember = "ID";
        this.ultraDropDown1.DisplayMember = "DisplayText";
    }
    
    private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
    {            
        e.Layout.Bands[0].Columns["Int32 1"].ValueList = this.ultraDropDown1;
    }

Reply Children