Readonly = True in DBSRichViewEdit

General TRichView support forum. Please post your questions here
Post Reply
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Readonly = True in DBSRichViewEdit

Post by alexandreq »

Hello Sergey

I put my Editor to readonly=true but I can still write on it.

Why?

I did this two way:

DBSrichViewEdit.Richview.readonly := True

Or

DBSRichViewEdit.ReadOnly := True

nothing happened, I can still write on the editor

Thanks
Alex
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

Hi,

I noticed that the readonly only works if I have my table opened.

If I call my form and my table is not opened, I can write in the DBSRichViewEdit, but if my table is opened and the readonly is true, it works fine.
Sergey Tkachenko
Site Admin
Posts: 17561
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

As I understand, the problem happens only if DBSRichViewEdit is linked to a closed table at the beginning: you can type in it.
If you close a table later, all should be correct.

Fix: open DBSRVE.pas, add the last line in constructor TDBSRichViewEdit.Create(AOwner: TComponent):

Code: Select all

TCustomRichViewEdit(RichViewEdit).ReadOnly := True;
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

Sergey,

I did that but a whenI opened the table, all information is not loaded in the DBSRichViewEdit.

Try it you and you will see.;

I need to disable the line you told me to insert.

thanks even so
Sergey Tkachenko
Site Admin
Posts: 17561
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Hmm... I cannot reproduce this problem.
I tried both assigning Table.Active=True at designtime, and calling Table.Open in code, it works as expected.
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

Sergey,

Have a table with some information and try to do what you told me to do.

When you open the table, the information should be display in DBSRichViewEdit, but not.

If you remove the line a fixed it, the information will be loaded when you open the table.

Try it.
Sergey Tkachenko
Site Admin
Posts: 17561
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Can you create a simple project reproducing this problem?
Post Reply