Custom BAQDataview to Grid - How to create on field change event...... ERROR

Hello All,

Has anyone been able to make an on field change event for a custom grid/dataview?

I am following some code from @josecgomez and @jgiese.wci where I bind a baq data view to a custom grid.

This code is wild because when you add it to the editor it adds a dataview that you can actually bind things to. However, I feel like the on change events are struggling to recognize it or maybe I am doing something blatantly wrong…

  baqViewWeights = new BAQDataView("gf-testweight");
  oTrans.Add("WeightsForOrder",baqViewWeights);

Now I would like to add some event handlers for field change events on the grid/datat view “WeightsForOrder,” but every time I do that I get errors as seen below.

Here is the change event:

  this.WeightsForOrder_Row.EpiRowChanging -= new EpiRowChanging(this.WeightsForOrder_BeforeRowChange);

‘Script’ does not contain a definition for ‘WeightsForOrder_Row’ and no extension method ‘WeightsForOrder_Row’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)

It’s almost as if the form doesn’t know about the dataview.

Has anyone been able to make an on field change event for a custom grid/dataview?

I’m thinking about making change events for the grid rows themselves, but still my question remains, why can’t I make a change event for the underlying custom BAQ data view?

That doesn’t exist try or somethiong like that.

baqViewWeights.dataView.EpiRowChanging += new EpiRowChanging(this.WeightsForOrder_BeforeRowChange);
1 Like

‘System.Data.DataView’ does not contain a definition for ‘EpiRowChanging’ and no extension method ‘EpiRowChanging’ accepting a first argument of type ‘System.Data.DataView’ could be found (are you missing a using directive or an assembly reference?)

It’s all good Jose, I appreciate you trying to help.

This is a curiosity project I am on to see how I can make a grid that someone can type into on an existing form and then do actions based on the field changing. I wanted to use existing data in the field change logic.

Just a curiosity.

Try this

baqViewWeights.EpiRowChanging += new EpiRowChanging(this.WeightsForOrder_BeforeRowChange);

That should work, the rowchanging event is tied to the EpiDataView if it doesn’t work you may have to cast your BAQDataView to EpiDataView.

Right on, that compiled Jose!

However, I should have first figured out how to make a column editable in the ultraGrid that it is bound to…

When I return the results from the BAQ using code I found(as seen below). The grid is all read only, can I not edit any of it?

I can even go to the collection in the properties tab and change the two fields from REad only = true to read only = false, but the settings don’t stay when I save the customization.

private void RefreshBAQDataView(BAQDataView iBaqView)
{
MethodInfo mi = iBaqView.GetType().GetMethod(“invokeExecute”, BindingFlags.Instance | BindingFlags.NonPublic);
mi.Invoke(iBaqView, new object{ true });
}

I have used another epimagic trick of yours in binding a baq result dataset from the dynamic query adapter to a grid which could also work here, but in that demo it isn’t a dataview… where I can do any change event logic.

Nah, I’m so far away from the right path here Jose. Thanks for answering the first change event logic question.

I am trying to get this BAQ to sub to a field on the screen as an execution parameter as well and I haven’t even tried that yet, but I sense it’s going to be a headache.

I appreciate your input here Jose! Again, I’m just playing around with epimagic today trying to solve something I could do with an embedded dashboard.