Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3768

DesktopListbox: Modifying or Rejecting a Cell Edit

$
0
0

Hi all,

I have a listbox with some cells of type DesktopListbox.CellTypes.TextField.

These cells are user-editable, but I want to validate the entries and either reformat them or reject the edit outright.

To do this, I have saved the cell’s original value in the .CellTagAt property.

However, in the CellTextChange event, if I try to change the CellTextAt(Row, Column) property and change the text of the cell, the change has no effect.

I think this is because my cell change is happening behind the .ActiveTextControl, which doesn’t know anything about my new .CellTextAt and overwrites it as soon as the edit is finished.

Trying to change the text in Me.ActiveTextControl.Text causes a stack overflow (because changing the text in that event triggers a new TextChanged event on itself).

Here’s a sample project illustrating the issue: Dropbox - listbox reject edits.xojo_binary_project - Simplify your life

Given there’s no event for when a cell’s edit is complete, what’s the best way to validate and modify a user’s edit in a listbox cell?

10 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 3768

Trending Articles