EP: Applying range to the datasource of AxGridView user control based on AxLookup user control selection

Hello,

I have 2 different web parts (user controls) on a custom EP page.

The first one contains only AxLookup control, which returns filtered list of locations and binds the selection to the TextBox (typical scenario found in pretty much every tutorial).

The second web part contains only AXGridView control, which returns Items in all locations.

I know, that I can filter AXGridView’s results by applying it’s native filtering options, but what I would like to achieve instead is to use the value I selected in AxLookup control I mentioned above.

So what I’ve done now is every time the value in TextBox changes I fire webpart.FireCurrentContextChanged(), which triggers AxBaseWebPart.GetWebpart(this).ExternalContextChanged += new EventHandler(WMSLocations_ExternalContextChanged) in AXGridView’s webpart.

This line is supposed to execute the following methods, however, when I set the break point on e.DataSetRunArgs.parm = “Location1” line - it’s never touched by debugger, although WMSLocations_ExternalContextChanged method doesn’t return any errors.

void WMSLocations_ExternalContextChanged(object sender, AxExternalContextChangedEventArgs e)
{
this.AXGridViewUserControl_DS.CreatingDataSetRun += new EventHandler(AXGridViewUserControl_DS_CreatingDataSetRun);

txtDebug.Text = "External Content CHANGED at: " + DateTime.UtcNow.ToString();
}

void AXGridViewUserControl_DS_CreatingDataSetRun(object sender, CreatingDataSetRunEventArgs e)
{
e.DataSetRunArgs.parm = “Location1”;
}

What am I doing wrong here?

Thank you!