[wxMSW][wx3.0.3] How to prevent editing some cells of a wxDataViewListCtrl

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Rudra
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 224
Joined: Fri Sep 13, 2013 2:59 pm

[wxMSW][wx3.0.3] How to prevent editing some cells of a wxDataViewListCtrl

Post by Rudra »

Hi,

In my wx application, I show a wxDataViewListCtrl. One of it's column's cell mode is set for wxDATAVIEW_CELL_EDITABLE. I don't want all cells to be editable. Is it possible to do so or somehow prevent user to edit some cells. I looked into dataview sample and tried using wxDataViewVirtualListMode::GetAttrByRow but don't know what to add code to disable a cell so that it can't be editable.

Plaase help.

Regards,
R.
Kvaz1r
Super wx Problem Solver
Super wx Problem Solver
Posts: 357
Joined: Tue Jun 07, 2016 1:07 pm

Re: [wxMSW][wx3.0.3] How to prevent editing some cells of a wxDataViewListCtrl

Post by Kvaz1r »

Why not use wxGrid instead wxDataViewListCtrl if you need hard operations with cells? This control provides much more features.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: [wxMSW][wx3.0.3] How to prevent editing some cells of a wxDataViewListCtrl

Post by ONEEYEMAN »

Hi,
EVT_DATAVIEW_ITEM_START_EDITING(id, func):
Process a wxEVT_DATAVIEW_ITEM_START_EDITING event. This event can be vetoed in order to prevent editing on an item by item basis.
Sometimes it is useful to check documentation... ;-)

Thank you.
Post Reply