Hey!
I figured I would just reuse this thread, since I figured out the answer to my prior question short after posting
My new quandary is that I can't seem to figure out how to 'lock' a column to a certain position, in wxDataViewListCtrl.
I want certain columns to be draggable, which I achieve using the flag "wxDATAVIEW_COL_REORDERABLE", but I want a specific column to always be the last slot.
If I set all the columns to be reorderable except my desired slot, the reorderable slots can still be moved past its location.
My next idea was to trigger a "wxEVT_DATAVIEW_COLUMN_REORDERED" event, and then reassign my column accordingly whenever the user reorders columns, but there are two issues with this idea I'm running into:
(A)
I'm not finding a SetColumnPosition function
(B)
When I try to duplicate the column, append it, and then delete the original, it is not placed at the last column position; rather, the second to last.
Any help would be really appreciated!
Set wxDataViewColumn Column Positions [thread redirect]
Set wxDataViewColumn Column Positions [thread redirect]
Last edited by Dafarkias on Tue May 04, 2021 3:35 pm, edited 3 times in total.
Re: Set wxDataViewColumn Minimum Width?
The event code looks something like this:
And as you can see, the append function is not adding the column on to the end, but rather, before the "squash" column.
Is there a way to prevent this behavior?
Code: Select all
void OnReorder(wxDataViewEvent& event)
{
wxDataViewColumn* column2 = columnComment;
this->InsertColumn(this->GetColumnCount(), column2);
this->DeleteColumn(columnComment);
event.Skip();
}
And as you can see, the append function is not adding the column on to the end, but rather, before the "squash" column.
Is there a way to prevent this behavior?