Grid not updating after publish value changes - BAQ DataView

Hello Team,
I’ve created a few BAQ DataViews in the past that subscribe to 2 publishers and they work fine, when a publisher value changes the grid updates

I’ve just created one that the second publisher is getting it’s data from an (unbound) EpiUltraCombo,

It loads fine in initialization filtering the BAQ with the first publisher, but when I select a new value in the EUC the grid doesn’t update

I think I need a second set of eyes to have a look at it - any suggestions would be much appreciated

Below is what I’ve tried

	public void CreatePackIdGrid()
    {
		Ice.Lib.Framework.EpiUltraCombo Combo = (Ice.Lib.Framework.EpiUltraCombo)csm.GetNativeControlReference("7610db31-4d67-4193-9651-8fea30f31a3d");
       
		packIdGridBAQDV = new BAQDataView("TWG_BOL_SHIPPED_BAQDV");
		
		oTrans.Add("PackIdGrid", packIdGridBAQDV);
						
		
        string pub3Binding = "BOLHed.BOLNum";
        IPublisher pub3 = oTrans.GetPublisher(pub3Binding);
        if (pub3 == null)
        {
            string pubName3 = Guid.NewGuid().ToString();
            oTrans.PublishColumnChange(pub3Binding, pubName3);
            pub3 = oTrans.GetPublisher(pub3Binding);
        }
        if (pub3 != null)
		{
            packIdGridBAQDV.SubscribeToPublisher(pub3.PublishName, "MscShpHd_BOLNum");
		}
		//MessageBox.Show("msg 4 - " + Convert.ToString(Combo.Value)); << This shows that there is no Data in the EUC

		string pub4Binding = Convert.ToString(Combo.Value);
        IPublisher pub4 = oTrans.GetPublisher(pub4Binding);
        if (pub4 == null)
        {
            string pubName4 = Guid.NewGuid().ToString();
            oTrans.PublishColumnChange(pub4Binding, pubName4);
            pub4 = oTrans.GetPublisher(pub4Binding);
        }
        if (pub4 != null)
		{
            packIdGridBAQDV.SubscribeToPublisher(pub4.PublishName, "MscShpHd_PackNum");
		
		}
	    }

	public void eucSelectPack_AfterCloseUp(object sender, System.EventArgs args)
	{
		//Ice.Lib.Framework.EpiUltraCombo Combo = (Ice.Lib.Framework.EpiUltraCombo)csm.GetNativeControlReference("7610db31-4d67-4193-9651-8fea30f31a3d");
		//MessageBox.Show("msg 5 - " + Convert.ToString(Combo.Value)); << This shows that there is Data in the EUC
		oTrans.NotifyAll();// << Added these to try and get some action
		oTrans.Update();
		oTrans.Refresh();
	}

And I’ve also tried this

	public void CreatePackIdGrid()
    {
		Ice.Lib.Framework.EpiUltraCombo Combo = (Ice.Lib.Framework.EpiUltraCombo)csm.GetNativeControlReference("7610db31-4d67-4193-9651-8fea30f31a3d");
       
		packIdGridBAQDV = new BAQDataView("TWG_BOL_SHIPPED_BAQDV");
		
		oTrans.Add("PackIdGrid", packIdGridBAQDV);
						
		
        string pub3Binding = "BOLHed.BOLNum";
        IPublisher pub3 = oTrans.GetPublisher(pub3Binding);
        if (pub3 == null)
        {
            string pubName3 = Guid.NewGuid().ToString();
            oTrans.PublishColumnChange(pub3Binding, pubName3);
            pub3 = oTrans.GetPublisher(pub3Binding);
        }
        if (pub3 != null)
		{
            packIdGridBAQDV.SubscribeToPublisher(pub3.PublishName, "MscShpHd_BOLNum");
		}
		//MessageBox.Show("msg 4 - " + Convert.ToString(Combo.Value)); << This shows that there is no Data in the EUC

		string pub4Binding = Convert.ToString(Combo.Value);
        IPublisher pub4 = oTrans.GetPublisher(pub4Binding);
        if (pub4 == null)
        {
            string pubName4 = Guid.NewGuid().ToString();
            oTrans.PublishColumnChange(pub4Binding, pubName4);
            pub4 = oTrans.GetPublisher(pub4Binding);
        }
        if (pub4 != null)
		{
            packIdGridBAQDV.SubscribeToPublisher(pub4.PublishName, "MscShpHd_PackNum");
		
		}
	    }

	public void eucSelectPack_AfterCloseUp(object sender, System.EventArgs args)
	{

		
		refreshBAQDataView(packIdGridBAQDV);
	}
	
	private void refreshBAQDataView(BAQDataView packIdGridBAQDV)
	{
	    MethodInfo mi = packIdGridBAQDV.GetType().GetMethod("invokeExecute", BindingFlags.Instance | BindingFlags.NonPublic);
	    mi.Invoke(packIdGridBAQDV, new object[]{ true });
	}

After having a look at some other Forum posts… is the reason that it is not working because I’ve tried to use a NativeControlReference on one of the Publishers???

@Carson, I got my original code from your posting/website, perhaps you may know??

I wouldn’t expect an unbound combo to work as a publisher.

If you don’t have too many records after the initial publish subscribe relation you could add a rowfilter to the dataview.

Something like

packIdGridBAQDV.dataView.RowFilter = String.Format("MscShpHd_PackNum = '{0}'",Combo.Value.ToString());

I didn’t check the syntax on the dataview on the BAQDataview. If you can’t filter it there you can certainly filter the epidataview.

Thanks @Carson,

I put that in the “AfterCloseUp” of the combo and it works fine… Is there by any chance a way to clear the filter and return all lines again??

This should remove the filter.

packIdGridBAQDV.dataView.RowFilter = "";

Thank you @Carson!!!,

You’re a gentleman and a scholar