List view displayed in 2 columns

I want to display a list view that is grouped by a field in 2 columns. Not sure how to accomplish this
Cat1                       Cat 2
1,2,3,4                    1,2,3
Cat3                       Cat 4
1                            1,2

I can programmatically create the view.  I am not sure how to get it into 2 columns.  here is my code.
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Collections.Specialized;
namespace SharePointProject3.WebPart1
    [ToolboxItemAttribute(false)]
    public class WebPart1 : WebPart
        protected override void CreateChildControls()
            using (SPSite site = new SPSite("http://site"))
                using (SPWeb web = site.OpenWeb())
                    web.AllowUnsafeUpdates = true;
                    //Get the List
                    SPList ProjectDocuments = web.Lists["Vendor"];
                    //Set the View fields
                    StringCollection ViewFields = new StringCollection();
                    ViewFields.Add("Type");
                    //Set the View Filter and Sort order
                    string viewQuery = @" <GroupBy Collapse=""TRUE"" GroupLimit=""100""> <FieldRef Name=""SubCategory""/>
</GroupBy><Where><And><Eq><FieldRef Name=""VendCat""/><Value Type=""Text"">eCommerce and Marketing</Value></Eq><Eq><FieldRef Name=""Active""
/><Value Type=""Boolean"">1</Value></Eq></And></Where>";
                    //Create the view
                    ProjectDocuments.Views.Add("Proposal Documents", ViewFields, viewQuery, 100, true, false);
                    //Update the List
                    ProjectDocuments.Update();
                    web.AllowUnsafeUpdates = false;
                    web.Dispose();
                site.Dispose();

Similar Messages

  • List view to include a column or field which would display the sequence number in a view

    I have a view for a list which displays items following any condition or sorting. Now, i would like to display the list items in such  a way that
    the auto incremented numbers are displayed as an arbitary field which would display the numbers such that
    its just going to display items in sequence. Is there anything that can be done in sharepoint designer for the list to accomodate a column/field which would display the sequence numbers.
    Thanks

    There are columns such as
    Name, Goals
    and  it should be arranged in descending order of Goals and it could be paginated but also a column should be displayed for ranks e.g
    Name Goals Rank
    A          40     1
    B          39     2
    C          30     3
    So, the idea is the ways it is sorted in descending order, if we possibly have a counter then we could display the ranking of the items.
    Thanks

  • List Views displaying error - when using Lookup column for filtering ( which are indexed )

    I'm trying to filter a large list that has more items than the list view threshold. The list has a lookup column that is indexed. If I  try to filter by other columns, the view works fine as long as it returns fewer than 5,000 items. However, if
    I try to filter by the lookup column, I get the error about not being able to display the items because the list is too large.
    The views are returning items which are less than threshold value , but still I am seeing the same issue.I Created some pages and added this filtered views to the pages it is showing below error
    This view cannot be displayed because it exceeds the list view threshold ....
    IF I navigate the view in the list it's returning zero records with out any error page . But no records. 
    Is there a known issue with filtering large lists by lookup column? Any other troubleshooting suggestions? Everything I'm doing here is through the web interface.

    Thank you for your reply. Yeah it’s default limit. But when I created view based on some filter condition on lookup column it’s not working.
    For example:
    Created a View based on Lookup column DEPT using filter condition Dept = HR , returned 1400 items
    Created another View based on Lookup column DEPT using filter condition Dept=Admin , returned 3600 items
    Adding this list view webparts to the page also working fine , displaying the results .
    After adding one item to this list , both the views are not displaying any results. Now the count is 5001.(it exceeded the list view threshold)
    The page where the list view web parts are added throwing the below error.
    This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator.
    To view items, try selecting another view or creating a new view. If you do not have sufficient permissions to create views for this list, ask your administrator to modify
    the view so that it conforms to the list view threshold.
    Learn about
    creating views for large lists.
    I am experiencing this problem only with lookup columns, Choice and site columns are working fine in this same situation .
    Thanks,

  • Modify list view - Group by Lookup column's ID

    Hi
    I have a main list that has a lookup column. The grouping works fine, but I want the sort order of the group to appear as the way the lookup value's ID is ...
    What are the ways to achieve this, I do not want to put a number in front of the values, is there another way to do this

    I understand that you don't want to add additional info in front of the lookup column values to keep the value exactly as expected.
    as SharePoint 2010 allows to lookup additional fields, I would suggest to lookup the item ID also with the lookup column.
    1. create a lookup column lookup your expected list.
    2. in the lookup column settings, "Add a column to show each of these additional fields", check "ID" column.
    3. group by the list view with the additional ID instead.
    There is an issue by doing this step, the groupby title value is the lookup ID column not the original lookup column, as we actually doesn't use the lookup columnn with grouping.
    For this, you can use SharePoint Designer to edit the list view, change the groupby row cell to the lookup column value instead.
    Qiao Wei <br/> My blog:http://blog.goobol.com

  • ITunes 11: Can't remove Genres column in playlist List View

    In previous versions, when playing playlists, I use List View, displaying only Artists and Albums. In iTunes 11, I'm unable to remove the Genres column; the items in View > Column Browser are grayed out.
    Also, ⌘-L (Go to Current Song) doesn't work.

    Just uncheck "Genres."

  • How to Hide Size Column in List View

    My default setting for the Finder is to have folders display in list view with the size column turned off. This works like a charm for every folder except the Applications folder which always displays a size column whenever the finder is re-launched (it's always scrolled to the bottom of the list too, which is weird). It wouldn't bother me if the size values were cached somehow and just updated quietly in the background but it takes quite a while to calculate each value and actually slows down the finder.
    I've tried deleting finder preferences but to no avail.
    Does anyone know what's going on here?
    [The above was originally posted here [http://discussions.apple.com/thread.jspa?messageID=9524102#9524102] but I was asked to move along by a surly faced police officer]

    OK. Problem fixed but unfortunately not completely solved.
    Talking about permissions and administrator issues made me wonder, so I logged in using my admin account and seemed to be having exactly the same issue. I was unable to set a default permamantly for the Applications folder. Except that when I tried to set a default in another folder (Documents I think) and restarted the Finder the setting held for all directories. When I logged back in under my regular user account it also held.
    I have finally eliminated that pesky size column -- for good! (Of course I may want it occasionally, but that's at my discretion). The window also maintains a correct scroll point, corresponding to where it was last positioned.
    I wish I knew exactly what has happened. All I really know is that fiddling (as usual) has fixed it and that it probably has something to do with Administrator privileges.
    Thanks again for your suggestions and especially for being a sounding board.
    Josh

  • Calculated column doesn't expand the items in list view

    Dear All,
              I have a calculated column
    Week with formula, =INT((DAY([Start Time])+6)/7) 
    in one of my lists. I'm displaying a view of this list in a SharePoint page, group by column Year and column
    Week. But when the page is loaded with items, I'm only able to expand the list view up to
    Year column level. When I click on Week section it doesn't show / expand the items under it.
    Further more when I use a different calculated column with a function like (=TEXT(Date,"yyyy")) I don't get above error.
    Any Idea?
    Thanks,
    Dilip

    Hi Dilip,
    According to your description, an issue occurs when you try to expand the subgroups in a list contains Calculated column.
    It is an known issue in SharePoint 2013, there are some workarounds I can provide as below:
    As the first workaround, you can set the groupings to expanded by default, though it would make the grouping collapsed by default, then the grouping would function
    normal.
    As the second workaround, you can create a SharePoint Designer Workflow and add a “Do Calculation” action to calculate the value you needed. Then add a “Update List
    Item” action to add the value to a “Single line of text” column. We will use the “Single line of text” column in the grouping instead of the Calculated column.
    As the third workaround, you can install the latest update of SharePoint to fix the issue for new Document Libraries. For the existing libraries, after the installing
    the update, you can use PowerShell to make an update to each item in the library, it will make the old items get normal in the grouping.
    About how to update list items in a list/library using PowerShell, a demo as below for your reference:
    $web = Get-SPWeb http://YourServer/
    $list = $web.Lists["list name"]
    foreach ($item in $list.Items)
    $item.SystemUpdate();
    Best regards
    Patrick Liang
    TechNet Community Support

  • List View still displays dates as numbers after 2.1 Hotfix

    Hi
    Just tried the List View component after installing Fix Pack 2.1 Hot Fix.   I  put a list view component on the canvas, selected 3 datesone for each header, changed the Appearance - Header to Date and then hit preview.  The first header worksshows the dates but the other two headers show numbers, not dates.
    The documentation shows that this was fixed,  see below
    ADAPT01260598 (List View displays
    dates as numbers)
    Description:
    The header area of List View displays date values as numbers.
    New Behavior:
    This issue is resolved.

    No, I was just wondering since I have a second device on TMobile US and haven't gotten the update. I loaded this OS almost a month ago when it leaked on the Internet.
    1. Please thank those who help you by clicking the "Like" button at the bottom of the post that helped you.
    2. If your issue has been solved, please resolve it by marking the post "Solution?" which solved it for you!

  • Adding "Filter Criteria" to the XSLT List View Web Part impact on "Export to Excel" functionality within Document Library

    Hi there,
    XSLT List View displaying all the list items within the Document Library. In order to implement the Search functionality within Document library out of box "Text Filter" web part is configured as explained below. The solution is similar to
    the one suggested at
    http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=77
    "Text Filter" Web Part added to the page.
    Filter Criteria (i.e., XSLT List View columns) added to the XSLT List View where the filter parameters take the input from the "Text Filter" Web Part .
      3. Both Web Parts (XSLT List View and the Text Filter) are connected.
    When the search criteria is entered into the "Text Filter" Web Part, it is passed to the relevant Columns of the XSLT List View and the documents (List Items) that match the search criteria are shown within XSLT List View.
    Search functionality working as expected.
    Query: Selecting the "Export to Excel" icon from the ribbon generates the excel spread sheet with no data except Column Titles from the Document library. In the investigation it is
    found that adding the 'Filter Criteria' on XSLT List View is causing this bug. When the Filter Criteria is removed, then "Export to Excel" functionality is working as expected.
    But it is mandatory to add "Filter Criteria" to implement the search functionality with in the document library.
    Help: Help/input appreciated on the work around to get the "Export to Excel" functionality work when the "Filter Criteria"
    exist on the XSLT List View.
    Regards,

    Once again thanks very much for your help Scott. very much appreciated.
    In the investigation it is found that removing the 'Filter Criteria' on XSLT List View makes the "Export to Excel" functionality work. But the 'Filter Criteria' is mandatory to get the 'Document Search' functionality.
    I think that due to technical limitations it should be concluded that 'only custom development can make all work, no code solutions using the SharePoint Designer can meet all the requirements.
    If you can think of any alternative solution that could help in resolving the current issue or fix the issue without any custom implementation please inform. Otherwise this issue would be marked as resolved with your suggested response.
    Regards,

  • List view, sizes seem to load very slowly

    I do not have "calculate all sizes" on. When I view the applications folder in list view, I do have column set to show size, however. I am amazed at how slowly that size colunm takes to fill in from the dashes. Is this how it is suppose to behave.

    As others have said, calculating the contents of folders takes a long time. Unlike in the past, most applications in OS X are actually application "packages", which are actually folders (eg. ctrl-clicking on one should have a "Show Package Contents" item in the contextual menu).
    In the past, sizes were not automatically shown for application packages unless the "calculate sizes" option was selected in the "Finder" - they were treated as folders (which they are). I remember this distinctly because it annoyed me - packages being treated as a single item when double-clicking while not carrying through the concept to calculating sizes. But on the flip side, this behaviour was helpful in distinguishing between .nib files and .nib folders from the GUI.
    In Leopard, the "Finder" now does treat packages as a single item when it comes to displaying sizes. So the "delay" you describe may not be that the "Finder" is slower but rather that it is doing more since it now has to calculate all of the application package sizes, which it was always slow at.

  • Split list view in finder

    Anyone know if there is any plugin (or app) for Finder that split list view in 2 independent columns, so I could drag and drop files (and folders) between folders more easily?
    Path Finder have this feature, but I wish to keep in finder (its free and follows the "less is more" idea).

    It's what I've been doing... I just thought that an plugin like these wouldn't be so hard to find! But that's alright!
    Thank's everybody!
    Message was edited by: Cesar Lucci
    Message was edited by: Cesar Lucci

  • How have a list view of last published documents when you are a contributor ?

    Hello,
    thanks for your help.
    here is the problem :
    - A library is set with versionning (draft and published) documents.
    - the library contain this documents
    - DOC A : version 1.3 : version 1.0 is published
    - DOC B : version 2.4 : version 2.0 was unpublished
    - Adam is a contributor of this library. He can create, edit, delete, publish, unpublish a document. His list view display DOC A v1.3 and DOC B version 2.4.
    - John is a reader of this library. He can only read the published documents. His list view display DOC A v1.0 only.
    To manage this library, Adam want to have the same view of this library as John. He want to view only the published documents.
    How can I give a published document view to Adam ?
    My first reflexe was to do a view filtering the versions containing ".0". The problem is that DOC A not appear, because the visibility version of this document is 1.3 for Adam (and 1.0 for John)
    How can I give him a published document view? perhaps with programmation, SharePoint Designer,...
    thanks for every help and samples.

    Give Adam a test account with the same permissions as John. It's the only way to be sure.
    w: http://www.the-north.com/sharepoint | t: @JMcAllisterCH | YouTube: http://www.youtube.com/user/JamieMcAllisterMVP

  • List view - how to set spacing

    I am running Mavericks on a MBP and want to set List view so the Name column doesn't stretch out all the way across the window - I want it to default to something only 1.5-2 inches on screen, so I can easily see and order things by the other columns [such as size, date etc.] - I can't figure out how to set up List View to have a default spacing setting = if I add Comments column [which generally is blank anyway] that'll do it but I don't want that, I just want to set up the Name column in list view to be more limited and not stretch all the way across on first opening.

    It's dynamic and requires showing more than just the name column. That's Apple's new paradigm.

  • List view problem

    I use List view. The left column contains icons for Applications, drives, etc., and I can add folders and files by dragging them to that column. But I can't *delete* them, either by dragging them out or hitting Delete or Opt-Delete. What do I do?

    Thanks, but I should have specified further. Neither Delete, Opt-Delete, Ctrl-Delete, CMD-delete (by which I assume you mean the Apple key + delete) nor any of these options with Shift works. What I'm trying to do is delete items from the left-hand column in List view (in fact, I now see that it's in all views) where you can drag folders, files,  individual apps, etc., to launch them directly instead of having to dig down in folders. It's baffling.

  • IiTunes 8 List view with artwork - track number?

    n list view, with the artwork column expanded, there is an additional column right after the artwork with the track number.
    What's this for?
    Can't remove it.

    not answered

Maybe you are looking for

  • Input fields vanishing with mouseover

    This bug seems to have started around FF14 and still persists to the latest version. In forms, all input fields will show as expected on page load. Then, when you move your mouse across the fields, some (but not all) will vanish and reappear, seeming

  • How to download the sd version of a movie onto my ipad, after purchasing the hd.

    I Buy hd versions of all my movie as they look better on the big screen tv. With that said, I only want to download the sd versions onto my iPads when were going to be on long car trips, otherwise I just stream it via wifi to save space. . i have wen

  • Network Manager Openvpn

    Hi all !! Good to be part of the arch commumnity I recently installed networkmanager package openvpn plugin pptp plugin vpnc plugin and the applet Although the Add button is enabled in the networkmanager gui when i choose to add an openvpn connection

  • Is it iCal's Memory Problem??

    Hi All, I am having about 2500 events and 500 tasks in my iCal's calendar, during syncing my iCal's calendar to my server's account constantly getting an exception (i.e Mac OS X Version 10.4.8 (Build 8L2127) 2007-01-11 10:20:06 -0800 2007-01-11 10:20

  • How do i put a photoshop picture on iweb?

    i have a picture in photoshop and i took out the white background so all i see is the checkerboard....when when i add it to iweb it shows white background.....all i want to see is the logo i made itself....with no white background