Index: /quintagroup.referencedatagridfield/trunk/quintagroup/referencedatagridfield/columns.py
===================================================================
--- /quintagroup.referencedatagridfield/trunk/quintagroup/referencedatagridfield/columns.py	(revision 2285)
+++ /quintagroup.referencedatagridfield/trunk/quintagroup/referencedatagridfield/columns.py	(revision 2286)
@@ -27,2 +27,51 @@
 # Initializes class security
 InitializeClass(HiddenColumn)
+
+class BlockColumn(Column):
+    """ Column with possibility to block the cell data from changing,
+        based on the value of the row data.
+    """
+    security = ClassSecurityInfo()
+
+    def __init__(self, label, default=None, label_msgid=None,
+                 column_on_class=None, column_off_class=None,
+                 columns=[], invert=False, read_only=None):
+        """ Create a column, with adding class attribute depend on value presence for the cell.
+        
+            @param column_on_class set class, which will be added to the <input> tag if columns has value
+            @param column_off_class set class, which will be added to the <input> tag if columns not has value
+            @param columns list of columns names, which values will be checked for set class attribute
+            @param invert - invert the adding class logic
+            @param read_only - check-on/off readOnly attribute for the <input> tag
+        """
+        Column.__init__(self, label, default, label_msgid)
+        self.column_on_class = column_on_class
+        self.column_off_class = column_off_class
+        self.columns = columns
+        self.invert = invert
+        self.read_only = read_only
+
+    def passCondition(self, row_data):
+        """ Return calculated class attribute."""
+        res = sum([1 for c in self.columns if row_data.get(c,0)])
+        return res == len(self.columns) and not self.invert
+    
+    security.declarePublic('getAttributesData')
+    def getAttributesData(self, row_data):
+        """ Return calculated class attribute."""
+        res = {'style_class': None, 'read_only': None}
+        isPassCondition = self.passCondition(row_data)
+        if self.column_on_class or self.column_off_class:
+           res['style_class'] = isPassCondition and self.column_on_class or self.column_off_class
+        if self.read_only:
+           res['read_only'] = isPassCondition and True or False
+
+        return res
+    
+    security.declarePublic('getMacro')
+    def getMacro(self):
+        """ Return macro used to render this column in view/edit """
+        return "datagrid_block_cell"
+
+# Initializes class security
+InitializeClass(BlockColumn)
Index: /quintagroup.referencedatagridfield/trunk/quintagroup/referencedatagridfield/skins/referencedatagridfield/datagrid_block_cell.pt
===================================================================
--- /quintagroup.referencedatagridfield/trunk/quintagroup/referencedatagridfield/skins/referencedatagridfield/datagrid_block_cell.pt	(revision 2286)
+++ /quintagroup.referencedatagridfield/trunk/quintagroup/referencedatagridfield/skins/referencedatagridfield/datagrid_block_cell.pt	(revision 2286)
@@ -0,0 +1,48 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:tal="http://xml.zope.org/namespaces/tal"
+      xmlns:metal="http://xml.zope.org/namespaces/metal"
+      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
+      i18n:domain="plone">
+      
+      
+<!-- View/edit free text columns 
+ 
+  -->
+
+<body>
+    <!-- VIEW -->
+    <metal:view_cell_macro define-macro="view_cell">                
+      <div tal:content="cell_value" />
+    </metal:view_cell_macro>
+
+    <!-- EDIT -->
+    <metal:edit_cell_macro define-macro="edit_cell">
+       <input style="width: 100%" name="myfield.name:records"
+	      tal:define="attribs python:column_definition.getAttributesData(rows);"
+              tal:attributes="name string:${fieldName}.${column}:records;
+                          id string:${column}_${fieldId};
+                          value cell_value;
+                          onchange eventHandler;
+                          readOnly python:attribs['read_only'];
+			  class python:attribs['style_class'];
+			  "
+	   type="text" />
+    </metal:edit_cell_macro>
+    
+   <!-- EMPTY EDIT -->
+    <metal:edit_empty_cell_macro define-macro="edit_empty_cell">
+       <input style="width: 100%" name="myfield.name:records" 
+                       tal:attributes="name string:${fieldName}.${column}:records;
+                                       id string:${column}_${fieldId};
+                                       value python: column_definition.getDefault(here);
+                                       onchange eventHandler;
+                                       "
+                       type="text" />
+    </metal:edit_empty_cell_macro>
+    
+    
+
+</body>
+
+</html>
+
