|
@@ -81,6 +81,7 @@ public class DynamicGridOptions
|
|
HideDirectEditButton = false;
|
|
HideDirectEditButton = false;
|
|
PageSize = 0;
|
|
PageSize = 0;
|
|
NonModalEditorHost = null;
|
|
NonModalEditorHost = null;
|
|
|
|
+ ReadOnly = false;
|
|
return EndUpdate();
|
|
return EndUpdate();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -117,7 +118,7 @@ public class DynamicGridOptions
|
|
private bool _addRows;
|
|
private bool _addRows;
|
|
public bool AddRows
|
|
public bool AddRows
|
|
{
|
|
{
|
|
- get => _addRows;
|
|
|
|
|
|
+ get => _addRows && !ReadOnly;
|
|
set
|
|
set
|
|
{
|
|
{
|
|
if(_addRows != value)
|
|
if(_addRows != value)
|
|
@@ -130,7 +131,7 @@ public class DynamicGridOptions
|
|
private bool _editRows;
|
|
private bool _editRows;
|
|
public bool EditRows
|
|
public bool EditRows
|
|
{
|
|
{
|
|
- get => _editRows;
|
|
|
|
|
|
+ get => _editRows && !ReadOnly;
|
|
set
|
|
set
|
|
{
|
|
{
|
|
if(_editRows != value)
|
|
if(_editRows != value)
|
|
@@ -143,7 +144,7 @@ public class DynamicGridOptions
|
|
private bool _deleteRows;
|
|
private bool _deleteRows;
|
|
public bool DeleteRows
|
|
public bool DeleteRows
|
|
{
|
|
{
|
|
- get => _deleteRows;
|
|
|
|
|
|
+ get => _deleteRows && !ReadOnly;
|
|
set
|
|
set
|
|
{
|
|
{
|
|
if(_deleteRows != value)
|
|
if(_deleteRows != value)
|
|
@@ -247,7 +248,7 @@ public class DynamicGridOptions
|
|
private bool _directEdit;
|
|
private bool _directEdit;
|
|
public bool DirectEdit
|
|
public bool DirectEdit
|
|
{
|
|
{
|
|
- get => _directEdit;
|
|
|
|
|
|
+ get => _directEdit && !ReadOnly;
|
|
set
|
|
set
|
|
{
|
|
{
|
|
if(_directEdit != value)
|
|
if(_directEdit != value)
|
|
@@ -353,6 +354,27 @@ public class DynamicGridOptions
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public bool _readOnly = false;
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// Specifies whether this grid is "read-only"; if this is <see langword="true"/>, then the <see cref="AddRows"/>, <see
|
|
|
|
+ /// cref="EditRows"/>, <see cref="DeleteRows"/> and <see cref="DirectEdit"/> will be disabled.
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <remarks>
|
|
|
|
+ /// Setting this property can improve performance, since it allows the grid to not load <see cref="LookupFactory.RequiredColumns(Type)"/>.
|
|
|
|
+ /// </remarks>
|
|
|
|
+ public bool ReadOnly
|
|
|
|
+ {
|
|
|
|
+ get => _readOnly;
|
|
|
|
+ set
|
|
|
|
+ {
|
|
|
|
+ if(_readOnly != value)
|
|
|
|
+ {
|
|
|
|
+ _readOnly = value;
|
|
|
|
+ Changed();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public delegate bool OnFilterRecord(CoreRow row);
|
|
public delegate bool OnFilterRecord(CoreRow row);
|