{"id":89,"date":"2007-05-12T13:50:12","date_gmt":"2007-05-12T11:50:12","guid":{"rendered":" http:\/\/www.nsonic.de\/blog\/2007\/05\/listview-oncustomdrawsubitem\/"},"modified":"2007-05-12T13:50:13","modified_gmt":"2007-05-12T11:50:13","slug":"listview-oncustomdrawsubitem","status":"publish","type":"post","link":"https:\/\/www.nsonic.de\/blog\/2007\/05\/listview-oncustomdrawsubitem\/","title":{"rendered":"ListView OnCustomDrawSubItem"},"content":{"rendered":"<p>Richard Sutcliffe wrote:<\/p>\n<p><em>> Can anyone show me how I can get OnCustomDrawSubItem to work? I have a<br \/>\n> standard report style TListView which shows filenames and icons in the<br \/>\n> caption\/first column and I wish to display the file folder and assoiated<br \/>\n> graphic in the first subitem and a checkbox icon in the second. I added<br \/>\n> code to do this to the CustomDrawSubItem event, however it didn&#8217;t work &#8211;<br \/>\n> I ensured DefaultDraw was false and stepped through my code to find that<br \/>\n> the event isn&#8217;t even fired off.<br \/>\n><br \/>\n> Is there a property I need to set to force OnCustomDrawSubItem to be<br \/>\n> used?<br \/>\n><br \/>\n> Thanks in advance<br \/>\n><br \/>\n> Richard Sutcliffe<br \/>\n> mailto:<br \/>\nrsutcliffe@bigfoot.com<br \/>\n<\/em> <\/p>\n<p>Two things are needed:<br \/>\n1. The control&#8217;s OwnerDraw property must be False (this seems odd, but owner<br \/>\ndraw and custom draw aren&#8217;t the same).<br \/>\n2. There must be an assigned OnCustomDrawItem handler. This doesn&#8217;t need to<br \/>\ndo anything, however, and in partricular it must NOT set DefaultDraw to be<br \/>\nFalse.<\/p>\n<p>Chris Jobson<br \/>\nRCP Consultants Ltd.<\/p>\n<p>[tags]Delphi, Components, ListView[\/tags]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Richard Sutcliffe wrote: > Can anyone show me how I can get OnCustomDrawSubItem to work? I have a > standard report style TListView&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[11],"tags":[90,75,78],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p71Tml-1r","_links":{"self":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/89"}],"collection":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/comments?post=89"}],"version-history":[{"count":0,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/posts\/89\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/categories?post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nsonic.de\/blog\/wp-json\/wp\/v2\/tags?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}