Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » ArrayCtrl : how to forbid editing of one row ?
ArrayCtrl : how to forbid editing of one row ? [message #30303] Thu, 23 December 2010 00:10 Go to next message
Didier is currently offline  Didier
Messages: 486
Registered: November 2008
Location: France
Senior Member
Hi,

I want to prevent editing certain rows of ArrayCtrl depending on the contained values.

Is there a way to do this
NB: StartEdit() method is not virtual so I can't derive the class Sad

Re: ArrayCtrl : how to forbid editing of one row ? [message #30351 is a reply to message #30303] Sat, 25 December 2010 20:55 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12020
Registered: November 2005
Ultimate Member
Didier wrote on Wed, 22 December 2010 18:10

Hi,

I want to prevent editing certain rows of ArrayCtrl depending on the contained values.

Is there a way to do this
NB: StartEdit() method is not virtual so I can't derive the class Sad




This is quite specific request Smile

If the ArrayCtrl is not supposed to hold MANY rows, I would probably used "the other" method of editing it, with embedded widgets for each row, and simply not assigned any for rows I do not want to edit.

void ArrayCtrl::SetCtrl(int i, int col, Ctrl& ctrl, bool value = true);

If this does not solve your problem, I am not strictly opposed to adding required option to ArrayCtrl Smile

Mirek
Re: ArrayCtrl : how to forbid editing of one row ? [message #30352 is a reply to message #30351] Sat, 25 December 2010 23:34 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1354
Registered: November 2005
Location: Poland
Senior Contributor

Another option is to use GridCtrl where you can enable/disable editing for particular row/column or cell.
grid.GetRow(10).Editable(false);
Re: ArrayCtrl : how to forbid editing of one row ? [message #30383 is a reply to message #30352] Mon, 27 December 2010 12:21 Go to previous message
Didier is currently offline  Didier
Messages: 486
Registered: November 2008
Location: France
Senior Member
Hi Mirek and undogs,

Quote:

Another option is to use GridCtrl where you can enable/disable editing for particular row/column or cell.


Actually I'm using SqlArray so changing to GridCtrl is not plug&play so I'll stick with SqlArray for now.


Quote:

If the ArrayCtrl is not supposed to hold MANY rows, I would probably used "the other" method of editing it, with embedded widgets for each row, and simply not assigned any for rows I do not want to edit.

void ArrayCtrl::SetCtrl(int i, int col, Ctrl& ctrl, bool value = true);


I will try this method, I didn't see it. I thought edit ctrls were only set to rows.
NB: I don't have many rows, and never will (max 100)

Thanks !

[Updated on: Mon, 27 December 2010 12:21]

Report message to a moderator

Previous Topic: Keeping EditString content in gridctrl
Next Topic: Feature request: DropGrid shifts to edit text mode if dynamic search results in 0 matches
Goto Forum:
  


Current Time: Wed Sep 18 23:48:56 CEST 2019

Total time taken to generate the page: 0.02701 seconds