{"id":12073,"date":"2010-12-09T07:00:00","date_gmt":"2010-12-09T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2010\/12\/09\/weve-traced-the-call-and-its-coming-from-inside-the-house-grid-lines-in-list-view-report-mode\/"},"modified":"2010-12-09T07:00:00","modified_gmt":"2010-12-09T07:00:00","slug":"weve-traced-the-call-and-its-coming-from-inside-the-house-grid-lines-in-list-view-report-mode","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20101209-00\/?p=12073","title":{"rendered":"We&#039;ve traced the call and it&#039;s coming from inside the house: Grid lines in list view report mode"},"content":{"rendered":"<p>\nA customer wanted to know how to remove the grid lines from\na list view control in report mode.\nThe customer was kind enough to include the source code for\nthe relevant part of the program and drew our attention to the\nline in the resource file that he believed to be the source of the\nproblem:\n<\/p>\n<pre>\nCONTROL \"\",IDC_LIST,WC_LISTVIEW,LVS_REPORT|LVS_SHOWSELALWAYS|\n       LVS_SINGLESEL|WS_HSCROLL|WS_TABSTOP|WS_VSCROLL,\n       0,40,225,95,WS_EX_CLIENTEDGE\n<\/pre>\n<p>\nThe customer didn&#8217;t know it, but that line in the resource\nfile was of no help at all in diagnosing the problem.\nFortunately, we found the root cause in the source code\nprovided:\n<\/p>\n<pre>\nvoid CListPage::OnInitDialog()\n{\n  ...\n  ListView_SetExtendedListViewStyleEx( hCtrl, 0,\n     LVS_EX_FULLROWSELECT |\n     <u>LVS_EX_GRIDLINES<\/u> |\n     LVS_EX_LABELTIP |\n     LVS_EX_HEADERINALLVIEWS);\n<\/pre>\n<p>\nThe grid lines are there because you explicitly asked for them!\n<\/p>\n<p>\nThe customer accepted this answer without response.\nOne of my colleagues suspected how this situation came about:\n<\/p>\n<blockquote CLASS=\"q\">\n<p>\nIf I may guess, the initial developer of the code did what\nthe spec required at the time, which was to have grid lines.\nThe initial developer then left the company, and a new\ndeveloper inherited the code.\n<\/p>\n<p>\nNow the design team changed their mind and asked for the grid\nlines to be removed,\nbut the new developer doesn&#8217;t know the history of the code\nand therefore doesn&#8217;t know where in the code the grid lines\nare turned on or even know that the default state for\ngrid lines is <i>off<\/i> and that\nyou have to turn them on explicitly.\n<\/p>\n<p>\nChances are within the next two months,\nthe design team will change their mind again and the developer\nwill have to put the grid lines back,\nbut at least this time he knows how to do it.\n<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>A customer wanted to know how to remove the grid lines from a list view control in report mode. The customer was kind enough to include the source code for the relevant part of the program and drew our attention to the line in the resource file that he believed to be the source of [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-12073","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>A customer wanted to know how to remove the grid lines from a list view control in report mode. The customer was kind enough to include the source code for the relevant part of the program and drew our attention to the line in the resource file that he believed to be the source of [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/12073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=12073"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/12073\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=12073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=12073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=12073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}