DVWP List Name instead of List ID
-
Thursday, January 06, 2011 4:58 PM
In SharePoint 2007, we can use the list name instead of the list ID to reference a list in the DVWP, this allow us to move the DVWP across different environments.
However in SharePoint 2010 I don't seem to be able to make this work, it only recognizes the List ID.
Do you if this is possible to do in 2010?? Please don't tell me that Microsoft removed that functionality from the DVWP.
Thanks.
K
K. http://www.sharepointwithattitude.com
All Replies
-
Thursday, January 27, 2011 12:19 PM
Hi
I am also facing similar issue of what Karla said. I am not able to use ListName instead ListID for dataview webpart in sharepoint 2010. Please help us.
Regards
Raj
-
Thursday, January 27, 2011 4:29 PM
Hi, it should works well with ListName. I started my DVWP from an Empty Data View and then I updated manually the DataFormParameter Name and ParameterKey from ListId to ListName. I also updated the parameterbinding Name from ListId to ListName and my dataview still works fine.
Cheers
Riccardo
fino a quì tutto bene -
Thursday, January 27, 2011 4:42 PM
Yes, that functionality still work in SharePoint 2010. We can use ListName instead of ListId parameter in DataFormParameter element.
<WebPartPages:DataFormParameter ParameterKey="ListName" PropertyName="ParameterValues" DefaultValue="Announcements" Name="ListName"></WebPartPages:DataFormParameter>
Regards,
Shantha Kumar .T | MCPD - SharePoint Developer 2010 | MCITP - SharePoint Administrator 2010 |
(B) Shantha Kumar's Blog | (T)Follow me | (C) IOTAP -
Thursday, February 10, 2011 12:03 PM
Thank you Kumar
I am sorry for late reply, These people updated some thing in their site and which didnt send me any alert when you posted your comments here.
I will try above webpart text and will let you know.
Thank you once again.
Regards
Raj
Thanks & Regards Raj -
Thursday, February 10, 2011 12:17 PM
Thank you Riccardo.
If you dont mind, could you please paste your first two lines of you DVWP where you are setting required attributes values to ListName to refer list name instead list id to populate values.
Thanks & Regards Raj -
Thursday, February 10, 2011 12:50 PM
yes, sure
<WebPartPages:DataFormWebPart runat="server" ... > <DataSources> <SharePoint:SPDataSource runat="server" ...> <SelectParameters> <WebPartPages:DataFormParameter Name="ListName" ParameterKey="ListName" PropertyName="ParameterValues" DefaultValue="Footprint"/> ... </SelectParameters> </SharePoint:SPDataSource> </DataSources> <datafields>...</datafields> <XSL>...</XSL> <parameterbindings> <ParameterBinding Name="ListName" Location="None" DefaultValue="Footprint"/> ... </parameterbindings> </WebPartPages:DataFormWebPart>
Cheers
Riccardo
fino a quì tutto bene- Proposed As Answer by Ibrahim K Friday, January 06, 2012 6:52 AM
-
Monday, February 14, 2011 3:36 PMI'm talking about the new XsltListViewWebpart in SharePoint 2010, have somebody done it in this dataview webpart?
K. http://www.sharepointwithattitude.com -
Tuesday, February 15, 2011 9:59 PM
Hi Karla, I never tried before, so I did some test now.
I tried using ListUrl, ListDisplayName and DatasourceID (creating a new datasource that points to my list), with no luck. Every time I save the page SharePoint Designer add the value for parameter ListName. Reading from MSDN I can't see anything else that seems to make it works.
Can I ask why you need to use XSLTListView Web Part and not DataForm WP?
Cheers
Riccardo
fino a quì tutto bene -
Tuesday, February 15, 2011 11:02 PM
Hi Riccardo, thanks for taking the time to do some testing.
Well, both the XSLTListView WP and the DataForm WP can be used to create views for different datasources; I'm working with SharePoint 2010 and Designer 2010, so in SPD when I add a DataView to my page it creates by default a XSLTListView WP, so I thought it was a good idea to give it a try. I like it better over the Dataform because it can also be customized on the browser, HOWEVER it doesn't seem to be possible to use the ListName to refer to a list, so obviously DataForm WP is WAY too much better.
Also, because of the XSLTListView is a new feature in 2010 I thought it could be better than the Dataform, but i guess not... I don't know...
K. http://www.sharepointwithattitude.com -
Monday, February 21, 2011 7:55 AM
Hi Riccardo,
Thanks a lot for your help. I will check with this.
Yup i am sure it will work.
Thanks & Regards Raj

