Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

E10 Adding a UD field to an EpiUltraGrid

E10 Adding a UD field to an EpiUltraGrid

E10 Adding a UD field to an EpiUltraGrid

I am trying to customize a EpiUltraGrid that we have on the order entry screen.
I am trying to add a new column with a database value which would read from a field called SalesDescription_c which is in the parts table as an extended ud field.

I have managed to add the column in and set a static value via

CODE --> C#

e.Row.Cells.Value = "String Here"; 
But now i want this to be dynamic and all of my efforts so far have failed.

The custom code from the script editor can be seen below:
I have tried various options found via Google and commented them out in the code.

CODE --> C#

// **************************************************
// Custom code for SalesOrderForm
// Created: 16/01/2015 16:33:34
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.UI;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;
using Erp.Adapters;
public class Script
    // ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
    // Begin Wizard Added Module Level Variables **
    private EpiBaseAdapter oTrans_partAdapter;
    // End Wizard Added Module Level Variables **
    // Add Custom Module Level Variables Here **
    Ice.Lib.Framework.EpiUltraGrid myGrid;
    public void InitializeCustomCode()
        // ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
        // Begin Wizard Added Variable Initialization
        this.oTrans_partAdapter = ((EpiBaseAdapter)(this.csm.TransAdaptersHT\\["oTrans_partAdapter"\\]));
        // End Wizard Added Variable Initialization
        // Begin Wizard Added Custom Method Calls
        // End Wizard Added Custom Method Calls
        myGrid = (Ice.Lib.Framework.EpiUltraGrid)csm.GetNativeControlReference("bec51417-b286-4d61-a471-3912bc098905");
        myGrid.DisplayLayout.Bands\\[0\\].Columns.Add("SalesDescription_c","Sales Description");
        myGrid.InitializeRow += new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(grdMatLst_InitializeRow);
private void grdMatLst_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
EpiDataView salesDesc = (EpiDataView)(this.oTrans.EpiDataViews\\["Stock"\\]);
//PartAdapter myOrderAdapt = new PartAdapter(this.oTrans); 
foreach(DataRowView drV in salesDesc.dataView.Table.Rows) 
object sValue = drV\\["SalesDescription_c"\\];
//int pNum = salesDesc.dataView.Table.Rows\\[0\\]; 
e.Row.Cells\\["SalesDescription_c"\\].Value = sValue.ToString();
//e.Row.Cells\\["SalesDescription_c"\\].Value = salesDesc.dataView.Table.Rows\\["SalesDescription_c"\\];
//e.Row.Cells\\["SalesDescription_c"\\].Value = "pNum";
    public void DestroyCustomCode()
        // ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
        // Begin Wizard Added Object Disposal
        // End Wizard Added Object Disposal
        // Begin Custom Code Disposal
        // End Custom Code Disposal
    private void SetExtendedProperties()
        // Begin Wizard Added EpiDataView Initialization
        EpiDataView edvOrderDtl = ((EpiDataView)(this.oTrans.EpiDataViews\\["OrderDtl"\\]));
        // End Wizard Added EpiDataView Initialization
        // Begin Wizard Added Conditional Block
        if (edvOrderDtl.dataView.Table.Columns.Contains("PartNum"))
            // Begin Wizard Added ExtendedProperty Settings: edvOrderDtl-PartNum
            edvOrderDtl.dataView.Table.Columns\\["PartNum"\\].ExtendedProperties\\["ZoneBAQ"\\] = "CustomSalesEntrySearch";
            edvOrderDtl.dataView.Table.Columns\\["PartNum"\\].ExtendedProperties\\["ZoneSearchOnEmptyControl"\\] = true;
            // End Wizard Added ExtendedProperty Settings: edvOrderDtl-PartNum
        // End Wizard Added Conditional Block
I am desperate to get this sorted ASAP, i'm rather new to C# in general so if you need any more information please let me know.

RE: E10 Adding a UD field to an EpiUltraGrid

You can create a BAQ for the part table and then create a BAQ combo box that will review the in the customization. When you get to the properties of the BAQ Combo you will fill in the following:

DisplayMember - Tablename.field
DynamicQueryID - BAQ Name
ValueMember - TableName.Field

Then go to the EpiBinding and bind the BAQ Combo to your field in the Table you are on.

Hope this helps.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close