DKehler
(Donovan Kehler)
September 6, 2024, 7:50pm
1
Hello,
I have added 4 UD Fields to the PartPlant table PartPlant_UD. These are not ‘Shortchar01’, I created these through ‘User Codes’.
These UD Fields are visible on Part Maintenance->Site->Detail
This is great, I figured out how to show the CodeDesc instead of the CodeID in the field so users can select the CodeDesc instead of the CodeID from the dropdown.
When I look at it in the ‘List’ view of all our Plants it uses the CodeID. How do i change the list views to display the CodeDesc?
klincecum
(Kevin Lincecum)
September 7, 2024, 11:40am
2
You need to get a hold of the grid, and using a bit of code, replace the column with the combo box.
I think I have an example around somewhere, let me see if I can find it.
DKehler
(Donovan Kehler)
September 9, 2024, 4:20pm
3
Thanks ill do some more digging in this area.
If you do have an example i’d love to see it, thanks.
klincecum
(Kevin Lincecum)
September 9, 2024, 4:25pm
4
private void SetupNMFCCombo()
{
try
{
string displayField = "Product";
string valueField = "NMFCCode";
List<string> sdl = new List<string>(){ valueField + "~" + displayField };
sdl.AddRange(nmfcCodes.Select(x => x[valueField] + "~" + x[displayField]).ToList());
cboNMFCCode = new EpiCombo()
{
RetrieveOnActivate = false,
EpiStaticDataList = sdl.ToArray(),
EpiColumns = sdl.FirstOrDefault().Split('~'),
ValueMember = valueField,
DisplayMember = displayField
};
cboNMFCCode.Font = new Font(cboNMFCCode.Font.Name, 16);
cboNMFCCode.Width = 800;
string phantomGridGuid = "7c8d2d07-d24a-4a4f-b0c2-613e684895d4";
EpiUltraGrid phantomGrid = (EpiUltraGrid)csm.GetNativeControlReference(phantomGridGuid);
phantomGrid.DisplayLayout.Bands[0].Columns[fieldAlias_NMFC].ValueList = cboNMFCCode;
phantomGrid.DisplayLayout.Bands[0].Columns[fieldAlias_NMFC].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
}
catch (Exception exOuter)
{
LogSystemException(this.GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod().Name, "Outer", exOuter);
}
}
hkeric.wci
(Haso Keric)
September 9, 2024, 4:32pm
5
Simply get a hold of the Guid for the Grid then assign your Combo to .ValueList in the _Load event
Example:
EpiUltraGrid grdReleaseList = ((EpiUltraGrid)csm.GetNativeControlReference("ade15bd6-f013-4543-a43d-871071e76021"));
grdReleaseList.DisplayLayout.Bands[0].Columns["smVI_Misc1_CodeID_c"].ValueList = cmbMyComboName;
1 Like
klincecum
(Kevin Lincecum)
September 9, 2024, 4:33pm
6
Damn it haso… make him work for it.
1 Like
hkeric.wci
(Haso Keric)
September 9, 2024, 4:34pm
7
Pretty much it If you have a combo use it, if not use Kevins snippet above to create one.
1 Like