Dear Team,
I tried to add rowfilter in existing base view dataset. But, am not able to add rowfilter and binding.
I’ve check the BOL flag = true in JobMtl table, that should not be binding in My Utltragrid with base dataset. Please find the Below code reference and tried the code. The BOL flag is UD column in this table.
private void edvMtl_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
// ** Argument Properties and Uses **
// view.dataView[args.Row][“FieldName”]
// args.Row, args.Column, args.Sender, args.NotifyType
// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
{
if ((args.Row > -1))
{
int tmpBol = 1;
EpiDataView edvMtl = ((EpiDataView)(this.oTrans.EpiDataViews["Mtl"]));
if (edvMtl.dataView.ToTable().Rows.Count > 0)
{
Ice.Lib.Framework.EpiUltraGrid grdMassIssue = (Ice.Lib.Framework.EpiUltraGrid)csm.GetNativeControlReference("7908565c-cc3c-43d1-b85b-9921ad88fb89");
foreach (DataRow dr in edvMtl.dataView.ToTable().Rows)
{
int tmpSeqNo = Convert.ToInt32(dr["SeqNum"].ToString());
string tmpParNo = Convert.ToString(dr["PartNum"]);
string tmpJobNo = Convert.ToString(dr["JobNum"]);
int rowFilter = 1;
string WhereClause = "JobMtl.BOL_c != '"+ rowFilter +"' and JobMtl.JobNum = '"+ tmpJobNo +"' and JobMtl.PartNum = '"+ tmpParNo +"' and JobMtl.MtlSeq = '"+ tmpSeqNo +"'";
DataSet dsJobMtl = csm.GetSearchRecords("JobMtlSearchAdapter","JobMtl", WhereClause);
if(dsJobMtl.Tables[0].Rows.Count > 0)
{
//DataView dView = myDataSet.Tables[0].DefaultView;
DataTable results = dsJobMtl.Tables[0];
if(results!=null)
{
DataView view1 = new DataView(results);
// Get Property
DataView varName = edvMtl.dataView;
//varName = null;
//DataTable table2 = view1.ToTable(false, "AssemblySeq", "MtlSeq", "PartNum","QtyRequired","QtyRequiredMtl","QtyIssued","Warehouse","BinNum","ToWarehouse","ToBinNum","IssuedComplete","PrevIssued","LotNum","UnitMeasure","StockQty","DispStopAction","ActTransUOM","TranDocTypeID","ManualNumberSuffix","RelatedOperSort","AbleToIssue","IsReturn");
grdMassIssue.DataSource = view1;
grdMassIssue.DataBind();
}
}
}
}
//System.Data.DataRow edvMtlRow = edvMtl.CurrentDataRow;
//if(edvMtlRow != null)
//{
//MessageBox.Show(edvMtlRow["SeqNum"].ToString());
//MessageBox.Show(edvMtlRow["SysRowID"].ToString());
//DataView dataView = MassIssueToMfgTableset.Tables[0].DefaultView;
//MessageBox.Show("1");
//string WhereClause = "JobMtl.BOL_c = 1";
//DataSet dsJobMtl = csm.GetSearchRecords("MassIssueToMfgAdapter","JobMtl", WhereClause);
//{
/*dataset ds =
DataView dataView = MassIssueToMfgTableset.Tables["JobMtl"].DefaultView;
dataView.RowFilter = "BOL_c = 1";
this.ugdIssue.DataSource = dataView;
this.ugdIssue.DataBind();*/
//}
//}
}
}
}