Hi, has anyone built a feature like the selection of security groups in the user file? I have an available list of items in user codes that I would like to have the user see in job entry and then select multiple items from the list and move them to a selected list. I see Epicor using feature in Role Codes selection, Attribute selection ETC. Not sure if anyone has done anything like this and if so, would you be able to provide suggestions on how it was accomplished?
Thx in advance…
I use something similar on many of my forms. My version doesn’t have the >> buttons, only the > type buttons.
I use lists to handle what it currently in the two gridviews and a delimited string to store it on my record.
Bits of code from it:
private void btnRemove_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
try{System.Data.DataRow currentRow = opMastView.CurrentDataRow;
currentCourse = grdRequired.ActiveRow.Cells["Value"].Value.ToString();
if (RequiredCourses.Contains(currentCourse)) RequiredCourses.Remove(currentCourse);
try{currentRow["WorkInst_c"] = RequiredCourses.Aggregate((a,b) => a + "~" + b);}catch{currentRow["WorkInst_c"] = "";}
grdRequired.DataSource = RequiredCourses;
try{RequiredCourses.Remove("");}catch{}
try{grdRequired.DisplayLayout.Bands[0].Columns["Value"].Width = 229;}catch{}
}catch{}
Fill_grdAll();
}
private void btnAdd_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
try{System.Data.DataRow currentRow = opMastView.CurrentDataRow;
currentCourse = grdAll.ActiveRow.Cells["Value"].Value.ToString();
try{grdRequired.DisplayLayout.Bands[0].Columns["Value"].Width = 229;}catch{}
if (!RequiredCourses.Contains(currentCourse)) RequiredCourses.Add(currentCourse);
grdRequired.DataSource = RequiredCourses;
try{RequiredCourses.Remove("");}catch{}
try{grdRequired.DisplayLayout.Bands[0].Columns["Value"].Width = 229;}catch{}
try{currentRow["WorkInst_c"] = RequiredCourses.Aggregate((a,b) => a + "~" + b);}catch{currentRow["WorkInst_c"] = "";}
}catch{}
Fill_grdAll();
}
Probably not the most efficient way to do it, but it works for me and hopefully you can pull a few things from it to point you in the right direction.
Joshua Giese @jgiese.wci shared this snippet once, an easy way to bind a BAQ to EpiListPickerPanel. I hope he doesnt mind sharing it as Kinetic is replacing WinForms, used to be worth gold, now its just worth silver.
// Script head
EpiListPickerPanel _atrpnl;
BAQDataView _bdvAttribut;
// Initialize custom code
_atrpnl = new EpiListPickerPanel();
SetupAttrListControl();
SetupAttributView();
// Method to handle your setup
public void SetupAttrListControl()
{
pnl1.Controls.Add(_atrpnl);
_atrpnl.PreserveSourceList = false;
_atrpnl.ReadOnly = true;
/** The following is broken down into a few simple parts. It generates a string list delimited by whatever character you would like
** This is only one of many implementations of InitDataBind. A screenshot above shows all of them. This is the only one I know how to use.
** It was modeled after the attributes in Customer Entry
** @SourceDataView (string) - This is the dataview containing the values for your source (left) list
** @SourceValueMember (string) - Think of this in terms of the dropdown list Value Member
** @SourceDisplayMember (string) - Think of this in terms of the dropdown list Display Column
** @StringDelimiter (char) - This is the character that you would like to use to seperate your values. Epicor typically uses ~ but you may use whatever suits your need
** @TargetColumn (string) - The column binding to insert the delimited string into
** @TargetDataView (string) - The dataview that your column to insert the string into resides.
** @Trans (EpiTransaction) - duh....
**/
_atrpnl.InitDataBind("Attribut", "Attribut_AttrCode", "Attribut_AttrDescription", ',', "AttrList", "AttrList", oTrans);
}
// Use a BAQ for the source list if the list you need can't be found in the native oTrans or able to be created in FKV
// See code snip http://codesnips.fortirisgroup.com/snippet/baq-data-views/ for more info on this
public void SetupAttributView()
{
_bdvAttribut = new BAQDataView("WCI-AttributeList");
oTrans.Add("Attribut", _bdvAttribut);
RefreshAttributView();
}
I’m actually working on something from a hard coded list right now. Not sure why I hard coded this guess I was feeling lazy. I have regrets
In which assembly (dll) it is? I want to see what are available methods and properties.
EpiListPickerPanel control I mean. I can’t find it in Object Explorer.
Is it any way to find the dll just to know the control name?
EDIT. Found it in Ice.Lib.EpiClientLib.dll.