Mine seems to work okay. I am not setting Company, Epicor behind the scenes is still setting that for me just fine in 10.2.600.8. I only set Key1 - Key5. With New Button or Enter, Tab - all seems ok on my 2 grids, but then again they are connected to JobMtl, not to a higher parent.
But maybe I did my initial code differently, letting Epicor handle the add new row natively, and notifying the UI (working with the Adapter, not the grid).
UUGH, I hate looking at code I wrote years ago… that’s probably the problem, looks like it’s littered with events. Why did I do it this way? (ironically I was probably in a hurry and not thinking things through, just flipping the puzzle piece around til it fit )
Well I should probably rework this at some point, the way you did it makes much more sense.
If you add the Wizard code from scratch, it tends to add in a few more events that it didnt do in 10.0 and E9 so it kind of started out that way I believe in 10.2.
Plus I wanted to support Paste Insert, Paste Update and had to mess with the code a bit more.
// this is new in 10.2
private void JobMtl_BeforeResetDataViewForUD03(object sender, EventArgs args)
{
// ** remove ListChanged event handler
this.JobMtl_DataView.ListChanged -= new ListChangedEventHandler(this.JobMtl_DataView_ListChangedForUD03);
}
private void JobMtl_AfterResetDataViewForUD03(object sender, EventArgs args)
{
// ** reassign DataView and add ListChanged event handler
this.JobMtl_DataView = this.JobMtl_Row.dataView;
this.JobMtl_DataView.ListChanged += new ListChangedEventHandler(this.JobMtl_DataView_ListChangedForUD03);
}
// Before switching to another JobMtl lets save
private void JobMtl_BeforeRowChange(EpiRowChangingArgs args)
{
// ** Argument Properties and Uses **
// args.CurrentView.dataView[args.CurrentRow]["FieldName"]
// args.ProposedRow, args.CurrentRow, args.CurrentView
// Add Event Handler Code
if (this._edvJobMtl.Row > -1)
{
SaveUD03Record();
}
}
private void grdCutPlan_BeforeRowInsert(object sender, Infragistics.Win.UltraWinGrid.BeforeRowInsertEventArgs args)
{
// Event handling code generated by wizard.
args.Cancel = true;
this.oTrans.SetCurrentEvent(TransactionEvent.AddNewOnNewFromGrid);
GetNewUD03Record();
}
private void grdCutPlan_BeforeRowsDeleted(object sender, Infragistics.Win.UltraWinGrid.BeforeRowsDeletedEventArgs args)
{
// Event handling code generated by wizard.
args.Cancel = true;
DeleteUD03Record();
}
private void grdCutPlan_KeyDown(object sender, System.Windows.Forms.KeyEventArgs args)
{
// Event handling code generated by wizard.
if (args.KeyCode == Keys.Escape)
{
UndoUD03Changes();
}
}
private void grdCutPlan_GridPasted(object sender, System.EventArgs args)
{
// Grid Pasting will reset the sort, lets add it back
grdCutPlan.DisplayLayout.Bands[0].SortedColumns.Add(grdCutPlan.DisplayLayout.Bands[0].Columns["Number20"], true);
grdCutPlan.DisplayLayout.Bands[0].Columns["Number20"].SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Ascending;
}
As you can see some of the items the Wizard in 10.2 threw in new. Maybe thats why.
Best if you generate Wizard code from scratch in old version and then in new and compare, whats new
The problem I’m having if there is two lines on the “Lines Detail” section it will add two new lines on the “Unavailable Parts” section I’m trying to make the section it’s own entity seperate from the lines details but have the same properties e.g when tabbed a new line is added or if the API posts a line another line is created waiting information.
Try adding, you will need to register the BeforeRowInsert
private void grdCutPlan_BeforeRowInsert(object sender, Infragistics.Win.UltraWinGrid.BeforeRowInsertEventArgs args)
{
// Event handling code generated by wizard.
args.Cancel = true; // We are stopping the default Inf Behaviour
oTrans.GetNewOrderDtl(); // We are telling oTrans Get me a new OrderDtl Line
}
I’m no longer getting that error but when I delete a line from Line Details one gets deleted from Unavailable Parts grid and I am unable to tab to create new line
My end goal is to have the Parts Unavailable to be their own entity because at the moment the lines copy “Line Details” e.g if I create a new line it will add a blank line on “Unavailable Parts” section which I don’t want and I also get an error Part Description is required which I don’t want.
your customization works fine in my version.
out of curiosity, on the 7th post, i noticed you hided lot of key fields.
can you unhide company field and test ?
if users manage the “unavailable part”,
you need to bind ud table to the grid as epidataview, and programmtically load/update/create data between ud table and order entry screen on order line actions.
if users not going to edit/add the “Unavailable part” view, you could simply call run a baq and bind the dataset to the grid.
if your intention of this modification is to manage unavailable stock, i hope you considered epicor “cross-dock” functionality
Yes the data will be posted using REST API from a website so I am wondering how I would create multiple lines in a BAQ based on that Sales Order Number?