Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Determining if a particular cell is read only?

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

Determining if a particular cell is read only?
Link Posted: 23-Aug-2006 05:43
Hi,

I am overriding PaintCell in my own Column class.

How can I tell from within this method if the cell I am painting is set to be readonly? Some cells for this column might be readonly, some might not.

Thanks,
Marina
Link Posted: 23-Aug-2006 06:54
You can use Column.IsReadOnly method to determine readonly state for certain cell.
Link Posted: 23-Aug-2006 08:48
I don't see an IsReadOnly method available to me in the column object. It does not appear in intellisense, and it does not compile.

I have version 22 installed.
Link Posted: 23-Aug-2006 08:54
This is protected method, you can access to this method via
[c#]
base.IsReadOnly(this.Owner.GetOwner(), dci.node);
Link Posted: 23-Aug-2006 09:15
I am using VB.NET.

I tried MyBase.IsReadOnly which is equivalent of base.IsReadOnly in C#.
I also tried Me.IsReadOnly which is equivalent of this.IsReadOnly in C#.

In both cases, no such method exists.
Link Posted: 23-Aug-2006 10:03
In this case update FlyGrid to the latest version 1.4.0.24
Link Posted: 24-Aug-2006 02:08
I just upgraded to version 24 from 22.

This method still does not exist.
Link Posted: 24-Aug-2006 02:13
I'm very sorry for delivered inconveniences, please use following method
[c#]
protected Column.OnIsReadOnly(NineRays.Windows.Forms.FlyGrid, NineRays.Windows.Forms.Data.NodeBase) : bool
Link Posted: 24-Aug-2006 02:41
This method does not return the correct result.

I am making a cell readonly by overriding the MakeEditorReadOnly method.  This part is working.

However, the OnIsReadOnly is not.

Additionally, this sounds like it would raise some sort of event?  The thing is, I don't want to keep re-evaluating whether or not the cell should be read only or not.  If I wanted to do that, I wouldn't be asking how to check if a cell was readonly - I would rerun my code that figures this out.

What I want, is a property that says if the cell is currently in a read only state, to avoid having to rerun code that is supposed to figure out if a cell is read only or not.

I would assume the grid has to know if a particular cell is currently read only or not? All I want to do, is to find out if that is the case - I don't want to rerun all the code that figure it out - that would be inefficient.

Thanks
Link Posted: 24-Aug-2006 03:04
Column.OnIsReadOnly use FlyGrid.IsReadOnly event (that dynamically control readonly state of node), Column.MakeEditorReadOnly methods specifies inplace editor's ReadOnly state.
It will be better if you override Column.OnIsReadOnly to make certain cells non-editable.