The best way I've found to manage this when i want to re-use the same DFWP in multiple sites is to actually replace the ListID parameter in the datasource with ListName parameter
That way as long as you use the same name for the list in all your sites the one web part definition will work fine. The down side to this is that it uses the list title rather than internal name, so if a user decides to change the name of the list the DFWP will break. So you need to keep this in mind if choosing to use this method.
Here's an example of what I mean. I've separated out the DataSource and DataFormWebPart controls to make it easier to read, but the syntax is identical if the datasource control is declared using the DataSourceString property of the DFWP, just search for ListID.
<SharePointWebControls:SPDataSource runat="server" ID="dsSampleDataSource" DataSourceMode="List" UseInternalName="true" selectcommand="[*Your CAML query here*]"> <SelectParameters> <asp:Parameter Name="ListName" DefaultValue="SampleList"/> <asp:Parameter Name="WebURL" DefaultValue="{sitecollectionroot}"/> </SelectParameters><DeleteParameters /><UpdateParameters /><InsertParameters /> </SharePointWebControls:SPDataSource> <WebPartPages:DataFormWebPart runat="server" ID="dfwpSampleDataView" SuppressWebPartChrome="True" ChromeType="None" WebPart="false" NoDefaultStyle="TRUE" DataSourceID="dsSampleDataSource"> <DataFields>additional fields to display here</DataFields> <parameterbindings> <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/> <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/> <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/> </parameterbindings> <XSL> <xsl:stylesheet ... </xsl:stylesheet> </XSL> </WebPartPages:DataFormWebPart>
Also you can leave the WebURL property empty if you want it to open the list in the current web, rather than the root web.