title: SharePoint 2013 How to use Web Part Connections? (Visual Web Part)
body: <p>I’m currently trying to use web part connections to connect an out the box List to my visual webpart. Now I can find lots of examples of connecting 2 custom web parts together using a user defined interface but am having trouble finding examples of the functionality I require.</p>
  
  <p>Scenario 1 : Ability to add my Visual Web part to a list view and connect them so my WP is the consumer of the List and that when the user clicks/selects a row in the list view my web part would get sent the id of the item.</p>
  
  <p>Scenario 2 : Ability to add my Visual Web part to a list display form and connect them so my WP is the consumer of the List item and the Id of the list item get passed to the WP when the form loads/displays.</p>
  
  <p>Now I know that this is what I need to consume the data</p>
  
  <pre><code>[ConnectionConsumer("Parameter", AllowsMultipleConnections = false)]
      public void ThisNameDoesNotMatter(IWebPartParameters provider)
      {
          _provider = provider ;
      }
  </code></pre>
  
  <p>but unsure of whether I should be using the IWebPartParameters, IWebPartRow or the IFilterConsumer.</p>
  
  <p>I guess I’m starting to wonder if this is even possible as I'm struggling to find any examples of this functionality.</p>
  
  <p>Any help would be great.</p>
  
  <p>Cheers
  Lee</p>