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?



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:



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="."/>

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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