I have created my own tracker EpiCombo on a Calculated field to show Part Status as Active/Inactive rather than using the Inactive fields Boolean checkbox. I have created a EpiStaticDataList on the Combo as Active/Inactive. I tried setting the default in InitializeCustomCode with epiCombo1.Value = “Active”, but it does nothing. I can do this for a Text Box and it works fine. I would also like to use AutRefresh on Load with these default. Any ideas?
I followed the example and it does work.
http://sandbox.datixinc.com/look-code-values-static-lists/
I do the customisation after the dashboard deploy.
Great information, this allowed me to get rid of a calculated field on simple Boolean fields. However I still cannot set a default value for any combo box, either based on a database field or a calculated field.
Is your tracker a input prompt only? As the combo box is bound to the field, it will set to the field based on what the view is.
If the tracker is input prompt only, I believe you can change it in the onLoad event.
It is input prompt only and I have tried setting a default in the onLoad event without success.
Then in that case, add a combo box, do not bind it to the view.
When the combo value change, update the checkbox of the Inactive field.
On the mainController Load, set the default value for the combo box.
// **************************************************
// Custom code for MainController
// Created: 29/10/2018 10:11:08 AM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Ice.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;
public class Script
{
// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
// Begin Wizard Added Module Level Variables **
// 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
// End Wizard Added Variable Initialization
// Begin Wizard Added Custom Method Calls
this.epiComboActive.ValueChanged += new System.EventHandler(this.epiComboActive_ValueChanged);
// 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.epiComboActive.ValueChanged -= new System.EventHandler(this.epiComboActive_ValueChanged);
// End Wizard Added Object Disposal
// Begin Custom Code Disposal
// End Custom Code Disposal
}
private void epiComboActive_ValueChanged(object sender, System.EventArgs args)
{
EpiCheckBox chkStatus = (EpiCheckBox)csm.GetNativeControlReference("ad2df7bd-1f42-4854-bb32-06d59f88f8ea");
EpiCombo activeCombo = (EpiCombo) sender;
// MessageBox.Show(activeCombo.Value.ToString());
// Part InActive
if(activeCombo.Value.ToString() == "True")
{
chkStatus.Checked = true;
}
else
{
chkStatus.Checked = false;
}
MainController.AppControlPanel.HandleToolClick("RefreshTool", new
Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["RefreshTool"], null));
}
private void MainController_Load(object sender, EventArgs args)
{
// Add Event Handler Code
EpiCombo activeCombo = (EpiCombo)csm.GetNativeControlReference("b9a89ecd-8d21-4865-81ac-5ec58bcfe898");
activeCombo.Value = "False";
MainController.AppControlPanel.HandleToolClick("RefreshTool", new
Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["RefreshTool"], null));
}
}
call FillList() method - for example - yourCombo.FillList();
