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 want to display the GUID of a ListItem in a column of a List. I have created a list with some fields, including a custom field to display the guid of each listitem, this field is not editable. When you create a new listitem, this field appears at the bottom of the page. When I press the ok button to confirm, you access in mode for display columns and the 'GUID Value' should be appear, but only when I go to edit the listitem the GUID Value appears. Why? Could someone help me?

My customField extends the BaseFieldControl class: which method or property I can override to display the GUID value both in edit and in view mode?

Thanks!!

share|improve this question

1 Answer 1

I was dealing with this EXACT problem yesterday. From what I can determine, the elements available to the list view are a few preselected hidden fields and any fields that are in the view. Unfortunately, GUID and UniqueId are not available. I went a different route and used generate-id() to get a unique identifier for the row, however if you need the GUID you may need to use ECMA to get it.

Some references:

http://msdn.microsoft.com/en-us/library/ff602042(v=office.14).aspx

http://msdn.microsoft.com/en-us/library/ff754327(v=office.14).aspx

And you can throw this into your field template to get all properties available to you

<xsl:for-each select="$thisNode/@*">
  <xsl:value-of select="name()"/> : <xsl:value-of select="."/>
  <br/>
</xsl:for-each>

I hope someone proves me wrong and can pull the data we need out. In the mean time, hope this helps.

share|improve this answer

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.