title: Event callback with blazor
body: <p>I am learning about EventCallBack with blazor, but i wanted to know</p>
  <ol>
  <li>Is there a way for my return method to return a second argument on the parent side. I would like to know the rowID that it came from</li>
  </ol>
  <p>Parent Code</p>
  <pre><code> @foreach (var rw in pg.rows)
      {
          @if (rw.rowDef == 1)
          {
              @if (rw.widgetsSection1.Count == 0)
              {
                  &lt;AddWidgetToColumnComponent rowID=&quot;rw.rowID&quot; onAddingWidget=&quot;AddWidgetToRow&quot;&gt;&lt;/AddWidgetToColumnComponent&gt;
              }
          }
      }
  }
  
  @code{
      ...
      private void AddWidgetToRow(GenericWidgets evnt)
      {
          //bool confirmed = await JsRuntime.InvokeAsync&lt;bool&gt;(&quot;confirm&quot;, &quot;Are you sure?&quot;);
          var row = pg.rows.Where(x =&gt; x.rowID == 3).FirstOrDefault();
          //row.addWidgetSection1(widgets);
      }
  }
  </code></pre>
  <p>Child Component AddWidgetToColumnComponent</p>
  <pre><code>&lt;button class=&quot;btn btn-info&quot; @onclick=&quot;@addComponent&quot;&gt;Ajouter&lt;/button&gt;
  
  @code {
      [Parameter]
      public int rowID { get; set; }
  
      [Parameter]
      public EventCallback&lt;GenericWidgets&gt; onAddingWidget { get; set; }
  
      public async void addComponent()
      {
          GenericWidgets widget = new GenericWidgets();
          await onAddingWidget.InvokeAsync(widget);
      }
  </code></pre>
  <p>I am not sure how to accomplish this, if possible (debugger give me error). The only other way would be to change my generic class to add the rowID attribute in it. But is there an other way?</p>
  <p>Change the lines ( what i would like it to be)</p>
  <pre><code>&lt;AddWidgetToColumnComponent rowID=&quot;rw.rowID&quot; onAddingWidget=&quot;AddWidgetToRow(rw.rowID)&quot;&gt;&lt;/AddWidgetToColumnComponent&gt;
  </code></pre>
  <p>and this line</p>
  <pre><code>private void AddWidgetToRow(GenericWidgets evnt, int rowID)
  </code></pre>