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 » How set read-only state to a editable column?
Re: How set read-only state to a editable column? [message #5597 is a reply to message #5596] Thu, 05 October 2006 11:27 Go to previous messageGo to previous message
unodgs is currently offline  unodgs
Messages: 1367
Registered: November 2005
Location: Poland
Ultimate Contributor

nicomesas wrote on Thu, 05 October 2006 04:30

unodgs wrote on Thu, 05 October 2006 00:25


I checked my code and it was there already... I only added NoEditable.

To make row not editable type:

grid.GetRow(0).NoEditable()
grid.GetRow(10).NoEditable()

or

grid.GetRow(0).Editable(false) in 0.95 version



This would be perfect! Smile

Another desirable thing, would be to be able to establish a cell determined like NoEditable.

The perfect thing would be this
  gridData.GetRow(4).GetCell(2).NoEditable(); 
  //set column 2 in row 4 to be read-only.

But I intuit that he is too complex.

What I believe that would be more easy it is to wait to an event WhenRowChange to change the edition mode of that cell in the row.

  void MyForm::WhenRowChange() { 
  int row = gridData.GetCursor();
  gridData.GetColumn(2).Editable(row != 4); 
}

I'm tested this piece of code and it and which does not work as I hoped, happens is that I can edit the column 2 in the row 4 without problems. Confused

Nico



gridData.GetColumn(2).Editable(row != 4);

Both GetColumn and GetRow returns ItemRect& which has Editable method, but only in GetRow context it works.

I will add in 0.96 sth like this...

grid.GetCell(4, 2).Editable(true/false)

..that's not a problem.

New version will be released soon (maybe as a part of upp), but I can put it on dgs.pac.pl even sooner if you want.

I will also make Editable working in GetColumn context. If column will be read-only it coudn't be edited even if it has edit assigned.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: first row strange behaviour
Next Topic: functions of HeaderCtrl [REQUEST?]
Goto Forum:
  


Current Time: Sat Jul 05 14:16:12 CEST 2025

Total time taken to generate the page: 0.03686 seconds