Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not 100% sure over the MVC way of doing this but I have achieved something similar.</p> <p>In my Business Layer Class </p> <pre><code>Class BL public event doneUpdate(o as object, e as eventArgs) sub method doDBUpdate() 'do your stuff RaiseEvent doneUpdate(o,e) end sub End Class Class Form dim withEvents bl as BL sub g handles bl.doneUpdate(o as object , e as eventargs) 'rebind end sub End Class </code></pre> <p>Now in your Code Behind for the form you can handle this event with a Sub that rebinds your data grid. </p> <p>Incidentally I bubble the event to a controller which the UI acts on rather than the business layer directly. </p> <p>Hope this helps</p> <p>EDIT:</p> <p>Hi Mitch </p> <p>The parameters passed from the event to the handler can be anything although Microsoft Coding Convention says that you should pass the object and the event args back. </p> <p>If you declare your event like this</p> <pre><code>Public Event myEvent(dim updated as Boolean) </code></pre> <p>and then have the handles sub have the same signature</p> <pre><code>Public Sub handler(byval updated as Boolean) handles myClass.myEvent </code></pre> <p>you should then be able the value of updated (this is only an example) </p> <p>The only thing you might want to check is that you are instantiating your Business Class as with Events </p> <pre><code>Dim WithEvents myBL as new BusinessLayer </code></pre> <p>If this still fails to work (if this in WinForms rather asp.net) you may need to say something like</p> <pre><code>AddHandler myBl.myEvent AddressOf handler </code></pre> <p>Hope this helps</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload