Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I was customizing list view web parts to meet our reqs. What I did was:

  • Instantiate ListViewWebPart in another web part
  • Set web (reflection), webid and list id
  • add ListViewWebPart to Controls collection of web part

However there are few discrepancies in behavior of standart list view web part and our web part

  • paging not working
  • if i add 2 or more web parts on the same page and on one apply the filter/sorting this is also populated to other web parts on the page. If the web part list does not contain the field it fails to render.

Anyone met with this behavior?

Thanks

share|improve this question
    
Are you talking about ListViewWebPart, or about XsltListViewWebpart? ListViewWebPart is old 2007-style web part, SharePoint 2010 uses XsltListViewWebPart to render list views, try to use it. –  Kai Mar 5 '13 at 7:45
    
hi, thanks. i am using ListViewWebPart. Well if I use XsltListViewWebPart the ECB menu is not working well. It renders, however I select one menu item I got error. But will try it –  Ivan Mar 5 '13 at 7:56
    
Hi. Do you add any custom controls or custom created asp controls? –  Andrew Adamich Mar 5 '13 at 8:12
    
Hi. No. just add ListViewWebPart to our web part Controls collection. –  Ivan Mar 5 '13 at 8:16

2 Answers 2

I've seen this problem before, on a Document Set homepage. The problem is that each webpart renders its own context object in DOM of the page, to be used in various javascript functions like sorting, paging, and also setting the ribbon.

Despite extensive investigation the best answer I can give you is that you need to decide which of the webparts is most important, and work from that.

What you then can do is to make the other webpart not rendering its context by specifying the NoCTX parameter in the view documented (somewhat) here.

OR. as a workaround that will only work in 2010, you can add the most important webpart to the end of the page, making its context the one used in javascript function. But that means that the other webpart will still break on sorting and filtering.

share|improve this answer

Try explicitly specifying the View in the ListViewWebPart. This is something I have done before in the past (wrapped that web part in another web part, by adding it to the Controls collection in CreateChildControls). I think this scenario only really works best if you leave it at one instance on a page though - unless you allow for specifying the List and View of the web part.

share|improve this answer
    
hi thanks, problem is that i am doing filtering based on user profile property value. therefore iam creating like on-the-fly view. sharepoint.stackexchange.com/questions/60247/… –  Ivan Mar 5 '13 at 8:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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