Edit SelectCommands of a hierarchical ListView
<p>I am using nested Listviews to view hierarchical data. The data is coming from an Access DB.<br>
At first I have a list of Devices, for every Device, I have a list of Modules, and for every Module, there are several Licences.<br>
Initially I only want to display Devices, Modules and Licences, which are currently up-to-date (For example only those Modules, which have an active Licence, I do this with a WHERE-clause in my SelectCommands).<br>
Until this point it all works fine.  </p>

<p>Now the question: I want a Checkbox (or Button, or something else) with which I can 'activate' all 'old' Modules and Devices (which initially won't be displayed).<br>
I think I have 2 options (but i don't know how to do, or if it is possible):</p>

<ol>
<li>Edit the SelectCommands: If i could access the SelectCommands on the 2nd level (Modules) in CodeBehind, I think i could get it to work, but I cannot access these 'AccessDataSource's because they are nested into the first ListView (Devices). </li>
<li>I could change my SelectCommands so I would get all Devices and Modules initially and then I had to hide the 'old' Items. And by clicking the Button (or Checkbox or whatever) I could unhide these items. But the decision whether the Module is 'old' or not comes from the Database. For Example: if there is a Module (level 2) and there are no related Licences (level 3) then this Module should be hidden (and only visible if I click the Button/Checkbox)</li>
</ol>

<p>I hope this was understandable and somebody can help me.</p>

<p>Here is my code:</p>

<pre><code>&lt;asp:ListView ID="ListViewDevices" runat="server"
DataSourceID="AccessDataSource1"&gt;
  &lt;ItemTemplate&gt;
    &lt;li&gt;
      ... some data of the Devices ...
      &lt;asp:ListView ID="ListViewModules" runat="server"
      DataSourceID="AccessDataSource2"&gt;
        &lt;ItemTemplate&gt;
          &lt;li&gt;
            ... some data of the Modules ...
            &lt;asp:ListView ID="ListViewLicences" runat="server" 
            DataSourceID="AccessDataSource3"&gt;
              &lt;ItemTemplate&gt;
                &lt;li&gt;
                  ... some data of the Licences ...
                &lt;/li&gt;
              &lt;/ItemTemplate&gt;
            &lt;/asp:ListView&gt;
            &lt;asp:AccessDataSource ID="AccessDataSource3" runat="server"
            DataFile="..." SelectCommand="..."&gt;
            &lt;/asp:AccessDataSource&gt;
          &lt;/li&gt;
        &lt;/ItemTemplate&gt;
      &lt;/asp:ListView&gt;
      &lt;asp:AccessDataSource ID="AccessDataSource2" runat="server" 
      DataFile="..." SelectCommand="..."&gt;
      &lt;/asp:AccessDataSource&gt;
    &lt;/li&gt;
  &lt;/ItemTemplate&gt;
&lt;/asp:ListView&gt;
&lt;asp:AccessDataSource ID="AccessDataSource1" runat="server" 
DataFile="..." SelectCommand="..."&gt;
&lt;/asp:AccessDataSource&gt;
</code></pre>
