I found the answer in the way you can deploy a custom NewForm.aspx page. Deploying modifications to the AllItems page takes the same approach.
- Copy the file found in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\Pages\viewpage.aspx into your solution. This is the file that's being used by SharePoint as AllItems.aspx as long as you don't make any changes (otherwhise it's ghosted into your content database).
- Make the changes you want to
- Change the schema.xml file and swop
Path="CustomAllItems.aspx" (or whatever you named the file)
- Make sure your new file is listed as an ElementFile in the element.xml file, so it actually get's deployed to the feature directory.
I faced a similar situation not long ago.
What I did was that I took a copy of the list's AllItems.aspx pasted it into my solution, made the modifications that I needed and then created a feature in which I pointed at the specific list and programmatic switched out the existing AllItems.aspx with my "custom" version of it.
list.DefaultDisplayFormUrl = URL to the new display form here;