I am adding two columns into Invoice Entry main grid which causes the grid not to clear when user clicks on the Clear icon (Broom). I tried to clear it programmatically inside AfterAdapter method for case “ClearData” or case “ClearList”, none of them works as they even prevent the form from loading.
I add columns using a similar code like this:
Ice.Lib.Framework.EpiUltraGrid ctrl = (Ice.Lib.Framework.EpiUltraGrid)csm.GetNativeControlReference(“fe13awbf-c0sd-4ae4-ad55-ece043bcf3ce”);
DataTable dt = ((DataView)ctrl.DataSource).ToTable();
if (!dt.Columns.Contains(“CPF”))
{
DataColumn newCol = dt.Columns.Add(“CPF”, typeof(string));
newCol.SetOrdinal(0);
newCol = dt.Columns.Add(“Freight”, typeof(decimal));
newCol.SetOrdinal(1);
ctrl.DataSource = dt.DefaultView;
}
Then I populate those columns. All works fine except the clear button.
I believe your issue is that you are breaking the EpiMagic.
By manually setting a DataSet instead using a custom EDV (which you can create to load that dt.DefaultView) and setting the EpiBinding, the oTrans has no clue what to do.
///In Initialize
//create a new EpiDataView
EpiDataView edvCustom = new EpiDataView();
//define it as dt.DefaultView;
edvCustom.dataView = dt.DefaultView;
//add it it to oTrans
oTrans.Add(“MyCustomEDV”,edvCustom);
//set the Epibinding on ctr to MyCustomEDV
after a restart of the form