Event Handler for a Matrix
Sebastian Schweer
Hallo Everybody,i tried a lot, but still can't find a solution.
I need to add an Event Handler to a Matrix. So that if someone select an Item, i mulitply automatically the Value of the Unit Price by 1.2 for example.
But i still can't add an EventHandler to a Matrix. I tried the following:
Matrix matrix = Matrix.GetFromUID(pVal.Form, "38") ; // the MATRIX
// ... lot of code ...
// Event Handler for Matrix
SwissAddonFramework.UI.EventHandling.ItemEvents.GotFocusEventHandler MatrixHandler = null;
MatrixHandler = delegate(SwissAddonFramework.UI.EventHandling.ItemEvents.GotFocus ev)
{
try
{
MessageBox.Show("hallo", "ok");
}
catch (System.Exception exe)
{
StatusBar.WriteError("Error" + exe.Message);
}
};
// ... lot of code ...
pVal.Form.Update();
// the Event Handler for
matrix.AddHandler_GotFocus(SwissAddonFramework.UI.Components.ModeComponent.FormModes.ALL, MatrixHandler);
This is a Got Focus Handler, because i still want to check if the Handler was working anyway. But sadly, this will not work.
Can anybody help me and give me an Example how to add an EventHandler to a Matrix.
Best Regards,
Sebastian
0
Please sign in to leave a comment.
Comments
0 comments