Background color row in ObjectListView filtered by cell value - VB.NET WinForms

我的梦境 提交于 2019-12-07 18:28:28

问题


Good afternoon,

It's being complicated to solve the problem that i am facing.

I have a ObjectListView filled and need to distinguish the rows that have a specific value in a cell.

So, if the cell as a value of 1 -> yellow row, value of 2 -> orange row, and so on..

I used the default ObjectListView control provided, no code used.

What is the best way to do that?

Thank you!


回答1:


The documentation on their site includes a very similar example through configuring a handler for the FormatRow event.

OLV Recipes

In my testing, however, I found that the event wasn't firing when I only used the SetObjects() method. I was able to get the event to work correctly after also calling RefreshObjects().

Reviewing their code: SetObjects() never calls PostProcessOneRow(). I'm not sure if this is intentionally left out or a bug.



来源:https://stackoverflow.com/questions/12862029/background-color-row-in-objectlistview-filtered-by-cell-value-vb-net-winforms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!