2

Within a SharePoint 2013 Community Site - I have additional fields in the 'Discussion List' but only the top 2 fields are displayed in the details view within 'Topic.aspx'. How do I get the other fields in the 'Discussion List' to display in 'Topic.aspx'(the other fields are available for editing for Owner roles but not for Readers nor other Contributors). The above question is similar to this unanswered question -

Sharepoint designer: Display custom field in a list

2
  • could you copy past the Topic.aspx code? i dont have 2013 on my vm atm but will know if its changeable through spd!
    – Ali Jafer
    Jan 28, 2014 at 11:41
  • there's no custom code - topic.aspx displays the default view with only two default fields and not the other custom fields that are added to the list. Jan 28, 2014 at 14:27

1 Answer 1

1

i know there is no custom code but you need to change the aspx to show your new fields!

as you pointed out it only displays the two fields! so you need to add in the extra custom fields to be displayed! i wouldnt of thought that its dynamic... if it was then they wouldnt of hard coded in two fields it would of been set to auto generate the columns!

if it was set to auto generate than there would be no need to change anything as it would be bound to show any field that is visible.

<SharePoint:SPGridView ID=”oGrid” runat=”server” AutoGenerateColumns=”true” >
</SharePoint:SPGridView>

but its not the above its:

<SharePoint:SPGridView ID=”oGrid” runat=”server” AutoGenerateColumns=”false” >
    <asp:BoundField DataField="ID" HeaderText="Request ref"/>
    <asp:BoundField DataField="Title" HeaderText="Title"/>
</SharePoint:SPGridView>

above is just an example! but the first there is no field but it auto generates any visible fields from the list, the second is set to false as you only want to show two fields! In your case you have the second but i presume that you want to have the first? you need to remove the boundfields and change AutoGenerateColumns to false.

if its not the case than you need to add in the extra bound fileds to show to the second example!

I would save a copy of the aspx first ;)

EDIT

<View Name="{83449315-F2F9-4AB6-A8A3-0B7C36747F4F}" Type="HTML" Hidden="TRUE" TabularView="FALSE" ReadOnly="TRUE" IncludeRootFolder="TRUE" DisplayName="" Url="/sites/csi/SitePages/Topic.aspx" Level="1" BaseViewID="12" ContentTypeID="0x01200200D3957DF85CB87244B242533AB0336C3E" ImageUrl="/_layouts/15/images/vwdisc.png?rev=23" CssStyleSheet="discthread.css" >

     <ViewFields>
        <FieldRef Name="LinkTitle"></FieldRef>
        <FieldRef Name="AssignedTo"></FieldRef>
        <FieldRef Name="Status"></FieldRef>
        <FieldRef Name="Priority"></FieldRef>
        <FieldRef Name="DueDate"></FieldRef>
        <FieldRef Name="PercentComplete"></FieldRef>
     </ViewFields>

     <Query>
        <OrderBy Override="TRUE">
            <FieldRef Name="Created" Ascending="TRUE"/>
        </OrderBy>
    </Query>
</view>

you need to have it somthing like the above, iv changed the base id so that it doesnt return the default view fields (that there is part of the issue).... you then add your own viewfields that you want to show and then the query to show/sort! You obviously need to change the fieldref to the internal name of the field you want to show! if there is a space in the field name than replace it with x0020 so if i have a field called "my home" i would do:

<FieldRef Name="my_x0020_home"></FieldRef>
2
  • there's no 'AutoGenerateColumns' in Topic.aspx - the code for display is different: (sorry can't get this to format right) <View Name="{83449315-F2F9-4AB6-A8A3-0B7C36747F4F}" Type="HTML" Hidden="TRUE" TabularView="FALSE" ReadOnly="TRUE" IncludeRootFolder="TRUE" DisplayName="" Url="/sites/csi/SitePages/Topic.aspx" Level="1" BaseViewID="2" ContentTypeID="0x01200200D3957DF85CB87244B242533AB0336C3E" ImageUrl="/_layouts/15/images/vwdisc.png?rev=23" CssStyleSheet="discthread.css" ><Query><OrderBy Override="TRUE"><FieldRef Name="Created" Ascending="TRUE"/></OrderBy></Query><ViewFields> Jan 29, 2014 at 15:26
  • just ammended the answer
    – Ali Jafer
    Jan 29, 2014 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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