wxDataViewCtrl with an expander column, hiding the ">" if the item has no children?

30 views
Skip to first unread message

Tony Kennedy

unread,
Feb 13, 2025, 8:41:55 AMFeb 13
to wx-users
Hi all,

I've got a wxDataViewCtrl. Works perfectly, some of the entries do not have child nodes though, and if possible, I'd like to hide the ">" symbol.

I've tried a custom renderer, no joy. Does anyone know if this is possible?

Thanks in advance,

Tony.

Vadim Zeitlin

unread,
Feb 13, 2025, 1:10:11 PMFeb 13
to wx-u...@googlegroups.com
On Thu, 13 Feb 2025 00:41:55 -0800 (PST) Tony Kennedy wrote:

TK> Hi all,
TK>
TK> I've got a wxDataViewCtrl. Works perfectly, some of the entries do not have
TK> child nodes though, and if possible, I'd like to hide the ">" symbol.

If an item doesn't have children, as indicated by the model IsContainer()
function returning false, it shouldn't have the expander and if you see it,
it would be a bug. In this case, as usual, please check if you can
reproduce it in the sample and report it, mentioning the wx version and
platform you use.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/

Tony Kennedy

unread,
Feb 13, 2025, 1:13:29 PMFeb 13
to wx-users
Ahh, I'll test then, it's probably my error.

Tony Kennedy

unread,
Feb 13, 2025, 3:41:11 PMFeb 13
to wx-users
Thanks for the pointer. All works well if I check the size of the child nodes during IsContainer.

bool IsContainer() const
{
    return m_bContainer && m_children.size() > 0;
}

Reply all
Reply to author
Forward
0 new messages