Display Listitems from sub folders in DataFormWebPart

Author: Anbu   13. March 2009

I had been running back and forth for an issue related to customization of DataFormWebPart. The main aim of the webpart was to reduce the coding - implementing a new webpart for just displaying the content from an existing list, in a tabular format.

I made a nice look & feel with the DFWP, but unfortunately, I was not able to bring items from the folder. My client desperately wanted to maintain items with same name in the list for different version of artifacts. Again it should be displayed in the root level while viewing. SharePoint's Views provide an option to list all list items in the same level (without showing the folder names).

To provide a solution to this issue using DFWP, I created another view and opened the ASPX file in SharePoint Designer. Now, I have answers to my questions. I can make the similar view using the DFWP.

As the designer writes most of the code, we do not realize to go deep into core of the features. By default the designer will not add the Scope attribute to the SPDataSource control.

<SharePoint:SPDataSource runat="server" DataSourceMode="List" SelectCommand="" UpdateCommand="" InsertCommand="" DeleteCommand="" UseInternalName="True" ID="Premium2" Scope="RecursiveAll" >< SelectParameters>

 

To retrieve all items from a list in C# use the ViewAttributes property of SPQuery object.

oQuery.ViewAttributes = "Scope=\"Recursive\"";

 

________________________________

Anbu Thangarathinam

 

Sharepoint

Comments

6/13/2009 4:35:20 PM #
good article.
11/15/2009 8:44:44 AM #
Just wanted to say thanks for this.
12/12/2009 12:11:53 PM #
I thought it was going to be some boring old post, but it really compensated for my time. I will post a link to this page on my blog. I am sure my visitors will find that very useful.
12/18/2009 12:02:41 AM #
Admiring the time and effort you put into your blog and detailed information you offer! I will bookmark your blog and have my children check up here often. Thumbs up!
12/18/2009 10:41:05 PM #
The blog was absolutely fantastic! Lots of great information and inspiration, both of which we all need!
12/19/2009 2:29:37 PM #
I admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well.
12/23/2009 6:48:41 PM #
I completely agree with the above comment, the internet is with a doubt growing into the most important medium of communication across the globe and its due to sites like this that ideas are spreading so quickly.
12/25/2009 9:12:14 PM #
Couldn?t be written any better. Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing!
12/27/2009 6:49:39 PM #
Resources like the one you mentioned here will be very useful to me! I will post a link to this page on my blog. I am sure my visitors will find that very useful.
12/28/2009 10:18:58 AM #
Nice resource. rss feed added
12/29/2009 6:36:47 AM #
I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else!
12/30/2009 7:28:52 PM #
I personally have embraced the new technologies and the CMS platforms, I think the new tools only make the web designs better. I am glad that new technologies are coming out in web design that make things easier, improved, and better looking for design.
1/1/2010 3:15:37 PM #
The blog was absolutely fantastic! Lots of great information and inspiration, both of which we all need!
1/3/2010 1:48:08 AM #
Aw, this was a really quality post. In theory I'd like to write like this too - taking time and real effort to make a good article... but what can I say... I procrastinate alot and never seem to get something done.
1/7/2010 1:06:10 PM #
You may have not intended to do so, but I think you have managed to express the state of mind that a lot of people are in. The sense of wanting to help, but not knowing how or where, is something a lot of us are going through.
1/9/2010 11:39:33 AM #
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon.
1/9/2010 6:55:40 PM #
Keep 'em coming... you all do such a great job at such Concepts... can't tell you how much I, for one appreciate all you do!
1/10/2010 6:36:17 AM #
While this subject can be very touchy for most people, my opinion is that there has to be a middle or common ground that we all can find. I do appreciate that youve added relevant and intelligent commentary here though. Thank you!
1/14/2010 10:04:24 PM #
I admit, I have not been on this webpage in a long time... however it was another joy to see It is such an important topic and ignored by so many, even professionals. I thank you to help making people more aware of possible issues.
Great stuff as usual...
1/16/2010 5:59:14 AM #
There are certainly a lot of details like that to take into consideration. That is a great point to bring up. I offer the thoughts above as general inspiration but clearly there are questions like the one you bring up where the most important thing will be working in honest good faith. I don?t know if best practices have emerged around things like that, but I am sure that your job is clearly identified as a fair game.
1/20/2010 2:32:15 PM #
Dude.. I am not much into reading, but somehow I got to read lots of articles on your blog. Its amazing how interesting it is for me to visit you very often.
1/21/2010 4:19:48 AM #
I am not much of a guy who thinks in so deeply about web design but I think your post had some valid points in it. Like designers are forced to design stuff within the limited code available and not go beyond it, their innovation is somewhat limited but still I think Web Design won't die! I agree that Amazon and other some big sites won't have a blog but now a days it's very important to have some sort of option available so people can quickly communicate their thoughts. I think Amazon if wants to shift it to that, they can get a customized CMS for themselves.
1/23/2010 5:32:10 AM #
Just wanted to give you a shout from the valley of the sun, great information. Much appreciated.
1/26/2010 5:52:07 AM #
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.
1/26/2010 1:18:36 PM #
While this subject can be very touchy for most people, my opinion is that there has to be a middle or common ground that we all can find. I do appreciate that youve added relevant and intelligent commentary here though. Thank you!
1/28/2010 7:12:01 AM #
If we wait for the moment when everything, absolutely everything is ready, we shall never begin.
1/28/2010 5:00:29 PM #
This is a really good read for me, Must admit that you are one of the best bloggers I ever saw.Thanks for posting this informative article.
2/2/2010 1:55:39 AM #
Couldn?t be written any better. Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing!
2/2/2010 8:42:21 PM #
Couldn?t be written any better. Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing!
2/6/2010 1:04:30 AM #
Hello,I love reading through your blog, I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the best of luck for all your blogging efforts.
2/7/2010 5:19:34 PM #
Well, this is my first visit to your blog! We are a group of volunteers and starting a new initiative in a community in the same niche. Your blog provided us valuable information to work on. You have done a marvellous job!
2/7/2010 5:32:34 PM #
I must say that overall I am really impressed with this blog.It is easy to see that you are passionate about your writing. If only I had your writing ability I look forward to more updates and will be returning.
2/11/2010 10:27:38 PM #
I was wondering what is up with that weird gravatar??? I know 5am is early and I'm not looking my best at that hour, but I hope I don't look like this! I might however make that face if I'm asked to do 100 pushups. lol
2/12/2010 5:59:19 PM #
Aw, this was a really quality post. In theory I'd like to write like this too - taking time and real effort to make a good article... but what can I say... I procrastinate alot and never seem to get something done.
2/13/2010 4:25:19 PM #
I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post
2/17/2010 3:05:34 AM #
Resources like the one you mentioned here will be very useful to me! I will post a link to this page on my blog. I am sure my visitors will find that very useful.
2/20/2010 12:51:23 PM #
Wow! what an idea ! What a concept ! Beautiful .. Amazing …
2/23/2010 2:54:13 AM #
Pretty nice post. I have sincerely enjoyed reading your website posts. I have been visiting blogs and sites in similar manner recently and i have to confess you have a nice design and content. Any way I will be subscribing to your feed and I hope you post more frequently.
2/23/2010 4:24:35 AM #
Hey... I don't know if you've been making changes, but your pages aren't displaying correctly for me. The margins look all screwed up. It wasn't like this yesterday. I don't know if it's something on my computer or if you've made a change... Just thought you might want to look at it.
3/2/2010 8:33:08 AM #
I was looking for crucial information on this subject. The information was important as I am about to launch my own portal. Thanks for providing a missing link in my business.
3/2/2010 11:45:55 PM #
I like streaming movies online, it is way cheaper than going to the theaters.
3/4/2010 3:43:24 PM #
Rather superb entry, definitely useful stuff. Never ever considered I'd find the facts I need right here. I have been looking everywhere in the internet for some time now and had been starting to get discouraged. Fortunately, I happened across your blog and received precisely what I was searching for.
3/7/2010 9:42:00 PM #
This is a amazing article, I found your web page researching google for a similar theme and arrived to this. I couldnt find to much alternative info on this piece of writing, so it was good to discover this one. I probably will be back to look at some other articles that you have another time.
3/8/2010 4:12:15 PM #
Awesome article.I've bookmarked it already. Cheers, Oliver.
3/10/2010 12:40:33 AM #
Success is the maximum utilisation of the ability that you have.

Add comment




  Country flag

biuquote
Loading