{"id":158,"date":"2006-09-28T10:24:40","date_gmt":"2006-09-28T09:24:40","guid":{"rendered":"http:\/\/www.galhano.com\/blog\/?p=158"},"modified":"2008-02-07T18:37:14","modified_gmt":"2008-02-07T17:37:14","slug":"access-to-datalist-value","status":"publish","type":"post","link":"http:\/\/galhano.com\/blog\/?p=158","title":{"rendered":"access to datalist value"},"content":{"rendered":"<p>You can access the Datalist values of a row like this :<\/p>\n<blockquote><p>\nIn the ItemDataBound event of the DataList,<br \/>\nif(e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==<br \/>\nListItemType.AlternatingItem){<br \/>\nobject row_items=e.Item.DataItem;<br \/>\n\/\/ If you have a column called customerId,<br \/>\nobject items = e.Item.DataItem;<br \/>\nstring str1=Convert.ToString(DataBinder.Eval(row_items,&#8221;c ustomerId&#8221;));<br \/>\n}\n<\/p><\/blockquote>\n<p>Additional info:<br \/>\nYou can find the controls in thge ItemTemplate of your datalist :<br \/>\nIn ItemDataBound event :<br \/>\neg :<\/p>\n<blockquote><p>\n((LinkButton)e.Item.FindControl(&#8220;LinkB&#8221;)).CommandA rgument=e.Item.ItemIndex.T<br \/>\noString();\n<\/p><\/blockquote>\n<p>This will set the commandargument for the Linkbutton, LinkB.<br \/>\nThe above code is in C#.<br \/>\nYou can easily convert it into VB.NET.Let me know if you have any<br \/>\nproblems.<br \/>\n<a title=\"http:\/\/www.velocityreviews.com\/forums\/t73019-access-to-datalist-value.html\" target=\"_blank\" href=\"http:\/\/www.velocityreviews.com\/forums\/t73019-access-to-datalist-value.html\"><br \/>\nMarshal Antony<\/a><!--009e8e7b6b8b9b533c156d78bb5f0bb0--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can access the Datalist values of a row like this : In the ItemDataBound event of the DataList, if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem){ object row_items=e.Item.DataItem; \/\/ If you have a column called customerId, object items = e.Item.DataItem; string str1=Convert.ToString(DataBinder.Eval(row_items,&#8221;c ustomerId&#8221;)); } Additional info: You can find the controls in thge ItemTemplate of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"close","ping_status":"close","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,4],"tags":[],"class_list":["post-158","post","type-post","status-publish","format-standard","hentry","category-code-snippets","category-aspnet","author-admin"],"_links":{"self":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=158"}],"version-history":[{"count":0,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/158\/revisions"}],"wp:attachment":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=158"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}