This project has moved and is read-only. For the latest updates, please go here.

Set custom datasource to assignmentlistwebpart

Topics: Developer Forum
Feb 12, 2008 at 12:10 PM

I have a problem where an assignmentlistwebpart should display all the assignments for a user but grouped by sites. I have an eLearning site structure where there is a home site from which instructors create new module sites. Each module site has it's own document library from where the user's create their assignments.

Now I need to display in the homepage the assignmentlistwebpart from each student but with the results grouped by module (subsite). I can't find a way to achieve that. First I tried to do it at the schema.xml file level but I thins it's not possible, first because I don't know the exact number of modules the site will have (I provide a module site definition and instructors will create modules as they need) and second because I can't write a condition filtering by the site id of the module because I don't know it beforehand.

What I'd like to do is to be able to change or filter at runtime the resulting set of the assignmentlistwebpart and be able to modify it based for example on each module site id, but I couldn't find a way to do it. Here are the approaches I tried:

  • I saw a macro delegate where all the conditions values are provided, maybe if I could provide my own macro procedures I'd be able to filter at runtime by the site id's value. Unfortunately, this is not possible and also there is the issue of providing your own delegate and retrieving the current item being evaluated somehow
  • I saw that assignmentlistwebpart calls queryresults.aspx and querysummary.aspx which are the responsibles of rendering the webpart's content, I'd like to create my own pages which could inherit from this base page classes and override the render methods to apply custom filters at the datatables objects after the queries have been called. Unfortunately, this methods are not marked as virtual.
  • Change the source code.... ultimately this works but it's something I wouldn't like to do, this is why I'm posting this question here.

Finally, It would be great if there was any way to assign a custom datatable to an assignmentlistwebpart object. This way, I could create the Query object at my assembly and assign it to it. Is there any way to configure the Queryresults.aspx and Querysummary.aspx urls for an assignmentlistwebparts ? I've seen that they are taken from the Constants static class so I think it's not possible. Being able to set those properties would also be great.

Any help will be appreciated, Thx in advance !