Jump to content


Photo

ReadOnly on indivual cell


  • Please log in to reply
5 replies to this topic

#1 Marc

Marc
  • Members
  • 62 posts

Posted 25 February 2007 - 12:15 AM

I want to lock a cell (not entire column or entire row) in my grid, on some conditions, so, dynamically .
How to do this ?

(I use inplace edits)

#2 bosjo

bosjo
  • Members
  • 75 posts
  • Gender:Male
  • Location:Märsta, Sweden

Posted 25 February 2007 - 06:24 PM

I'm not 100% sure what you want to achieve, but in the last version there is an event, OnBeforeSelect, which you can use for this; at least I use it to make some cells "read-only"... Just set CanSelect to false for the readonly cells.

I have not used inpleace edits, so I don't know whether that will cause problems, but I shouldn't think so.

#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 25 February 2007 - 07:45 PM

Hello Marc,

I think that you may use OnBeforeSelect for your case.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#4 santiago14

santiago14
  • Members
  • 25 posts

Posted 03 January 2017 - 12:29 AM

Late but safe.
Actually, you should use the onBeforeEdit event.
Here the example, taken from these same forums:
 

 

procedure TForm2.NextGrid1BeforeEdit(Sender: TObject; ACol, ARow: Integer;
  var Accept: Boolean);
begin
  Accept := TNextGrid(Sender).Cell[ACol - 1,ARow].AsString = 'key2';
end;

 

By the way, it is for future reference.

 

Santiago.



#5 jamiguel77

jamiguel77
  • Members
  • 137 posts
  • Gender:Male

Posted 11 August 2019 - 07:26 PM

i use d7 and nextgrid version 5.9.85 how to chnge font color for a specific cell?

 

thanks



#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 11 August 2019 - 08:59 PM

Hi,

There is OnCellFormating event that can be used.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users