{"id":1178,"date":"2011-06-21T10:07:32","date_gmt":"2011-06-21T08:07:32","guid":{"rendered":"http:\/\/www.itidea.nl\/?p=1178"},"modified":"2011-12-12T10:06:32","modified_gmt":"2011-12-12T09:06:32","slug":"bind-spgridview-field-to-generic-list-of-strings","status":"publish","type":"post","link":"https:\/\/www.itidea.nl\/index.php\/bind-spgridview-field-to-generic-list-of-strings\/","title":{"rendered":"Bind (SP)Gridview field to generic list of strings"},"content":{"rendered":"<p>Probably this is my lack of knowledge in the (sp)gridview area, but I want to share it anyway.<\/p>\n<p>I realized I always bound gridviews to custom objects only. Recently I wanted to bound a generic list of strings (List&lt;string&gt;) to a field in a gridview and didn&#8217;t know how to accomplish this. After trying a few options and some searching I found the answer:<br \/>\nAn exclamation mark: !<\/p>\n<p>Example:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nBoundField field = new BoundField();\r\nfield.DataField = &quot;!&quot;;\r\n<\/pre>\n<p>Never thought of this one myself.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Probably this is my lack of knowledge in the (sp)gridview area, but I want to share it anyway. I realized I always bound gridviews to custom objects only. Recently I wanted to bound a generic list of strings (List&lt;string&gt;) to &#8230; <a class=\"more-link\" href=\"https:\/\/www.itidea.nl\/index.php\/bind-spgridview-field-to-generic-list-of-strings\/\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[20],"class_list":["post-1178","post","type-post","status-publish","format-standard","hentry","category-sharepoint-2010","tag-c"],"_links":{"self":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts\/1178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/comments?post=1178"}],"version-history":[{"count":5,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts\/1178\/revisions"}],"predecessor-version":[{"id":1182,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts\/1178\/revisions\/1182"}],"wp:attachment":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/media?parent=1178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/categories?post=1178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/tags?post=1178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}