You can add any of the fields to a view based on their internal name. For example, the internal name of the field for the documents icon is "DocIcon" and the correct field to use for the title field with the edit menu is "LinkFilename".
If you are unsure what the internal name of a field is that you want to use a view, you can try this - build the view in SharePoint and then go to the 'modify this view' page. Then with the IE Dev Toolbar (or firebug if you are a fix fox user) select the check box for the field you need the internal name of. You will see that it has an onclick attribute that will look like this "javascript:ShowHideTotals(this, 'LinkFilename')". The internal name for the field the checkbox corresponds to is the second parameter in the JavaScript function. I hope that helps Brian Farnhill Consultant Technical Consulting Mobile: 0408 289 303 Fax: 02 8001 7778 Email: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> Web: www.uniqueworld.net<http://www.uniqueworld.net> Blog: pointstoshare.spaces.live.com<http://pointstoshare.spaces.live.com/> [cid:image001.jpg@01C9081A.C5FA58E0] From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Witherdin, Nigel Sent: Wednesday, 27 August 2008 2:16 AM To: listserver@ozMOSS.com Subject: RE: [OzMOSS] Setting Library View Programmatically OK, I found a cheat of a way to do this, by cloning the "All Documents" view and removing/adding fields as I needed to. But I would still be interested in knowing how to add these "special" fields programmatically if anyone knows? Cheers, Nigel Witherdin Senior Support Analyst Eversheds Direct Dial: +44 (0) 84 549 754 17 Mobile: +44 (0) 7738 553256 www.eversheds.com<http://www.eversheds.com/> ________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Witherdin, Nigel Sent: 26 August 2008 16:49 To: listserver@ozMOSS.com Subject: [OzMOSS] Setting Library View Programmatically Hi All, In a feature event receiver I am trying to create some views for a particular list as per this code: ---- //Ordered by Reference number SPViewCollection views = spLibrary.Views; StringCollection libViewFields = new StringCollection(); libViewFields.Add("File_x0020_Type"); libViewFields.Add("Reference_x0020_Number"); libViewFields.Add("Modified"); libViewFields.Add("Item_x0020_Author"); libViewFields.Add("Item_x0020_Title"); libViewFields.Add("FileLeafRef"); libViewFields.Add("Group1"); qry = "<OrderBy><FieldRef Name='Reference_x0020_Number' Ascending='True' /></OrderBy>"; libViews.Add("Ordered by Reference Number", libViewFields, qry, 100, true, false); spLibrary.Update(); ---- This is all working fine, but I would really like to add the "File Type" column so that it shows an icon for the file type, and the name (FileLeafRef) column so that it has the dropdown edit menu. Anybody have any idea how to create these view fields programatically Many thanks Nigel Witherdin Senior Support Analyst Eversheds Direct Dial: +44 (0) 84 549 754 17 Mobile: +44 (0) 7738 553256 www.eversheds.com<http://www.eversheds.com> ********* This email is sent for and on behalf of Eversheds LLP ********* This email is sent for and on behalf of Eversheds LLP which is a limited liability partnership, registered in England and Wales, registered number OC304065. Registered office One Wood Street, London, EC2V 7WS. Registered VAT number GB820704559. A list of the members' names and their professional qualifications is available for inspection at the above office. Regulated by the Solicitors Regulation Authority (see www.sra.org.uk<http://www.sra.org.uk/>). Confidentiality: This email and its attachments are intended for the above named only and may be confidential. If they have come to you in error you must take no action based on them, nor must you copy or show them to anyone; please reply to this email and highlight the error. ************* [ www.eversheds.com<http://www.eversheds.com/> ] ************* ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com ------------------------------------------------------------------- OzMOSS.com - to unsubscribe from this list, send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com
<<inline: image001.jpg>>