0

I have to prepare .aspx page with XsltListViewWebPart, which query depends on currently logged user. The query is complicated (querying over 3 lists..., I must find my juniors in Department user hierarchy list and filter Invoice list if MultiUserField App_Members contains >1 of my juniors = Inovices I am responsible for). Goal is to show page, where filtered XsltListViewWebPart act as a "Master control" and related items/infopath forms/previewers are connected into it as "related controls". How to solve it, please ?

  • If I develop programtically Web part , which contains XsltListViewWebPart as a control included, I will loose all connections and I must handle it my own way.
  • If I add XsltListViewWebPart to page FilteredView.aspx using SPLimitedWebPartManager, I think there only static query can be saved...
  • XsltListViewWebPart can be used to query against one list only. – Nadeem Yousuf Oct 27 '15 at 10:23
  • Thanks, yes OK. I am querying only 1 list - in final. But at the beginning, I must find all my juniors. So query snippet will looks like: select * from Invoice where (App_Members contains 'John' .or. App_Members contains 'Jane' ....) – Marian Oct 27 '15 at 10:25
0

XsltListViewWebPart displays a view of a list. Period. If you can't filter out items by using out-of-the-box functionality (configuring the view), then you need a custom web part. You can start by looking into System.Web.UI.WebControls.WebParts.WebPart class. What you will need to do is override CreateChildControls(). There you will be able to query as many lists and do whatever checks you want. This and this are good resources to start with. 2010 is the same as 2013 from that point of view.

  • Thank you for resources. As I wrote before, if I develop web part programatically, I have to handle all type of connections, because my web part will act as a "Master". And its a problem to handle connection "Get Form from" for Infopath connected web part . It's historically done. I cannot remove this Infopath web part from page. – Marian Oct 27 '15 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.