Navigation:  Classes > bDataColumn >

bDataColumn:EditCondition

Print this Topic    Previous pageReturn to chapter overviewNext page

Purpose

List of edit conditions that are to be considered for editing cell values.

Class

bDataColumn

Type

Access

Data Type

bEditConditionList

Description

With the access bDataColumn:Editable editing of values can be enabled or disabled for the column. If editing is enabled for column values, then additional edit conditions can be defined with the access bDataColumn:EditCondition in order to define when a cell value may be edited. For example it is possible, that a cell value can be edited only if a field contains a certain value.

 

Whether edit conditions are defined can be checked with the method bDataColumn:ExistEditConditions().

 

In addition to the edit conditions in the column, edit conditions can be defined with the access bBrowser:EditCondition for the bBrowser also.

Samples

The following sample defines an edit condition for the column #DEC with that editing is prevented provided the field #TYPE does not contain the value "N".

 

LOCAL oasDBSTRUCT    AS bArrayServer

LOCAL auStruct       AS ARRAY

LOCAL oBrowser       AS bBrowser

LOCAL oColumn        AS bDataColumn

LOCAL oEditCondition AS bEditCondition

 

// create bArrayServer

auStruct := {;

                               {"NAME", "C", 10, 0},;

                               {"TYPE", "C", 1, 0},;

                               {"LEN", "N", 3, 0},;

                               {"DEC", "N", 2, 0};

                       }

oasDBSTRUCT := bArrayServer{auStruct}

 

// create bBrowser

oBrowser := bBrowser{oOwner,;

                                               1000,;

                                               Point{0, 0},;

                                               Dimension{300, 250}}

oBrowser:Use(oasDBSTRUCT)

oBrowser:Show()

 

// determine column #DEC

oColumn := oBrowser:GetColumn(#DEC)

IF oColumn<>NULL_OBJECT

       // create editable condition

       oEditCondition := bEditCondition{'Server:TYPE<>"N"',;

                                                                        oasDBSTRUCT,;

                                                                        FALSE}

       oColumn:EditCondition:Add(oEditCondition)

ENDIF

See Also

bBrowser:EditCondition

bDataColumn:Editable

bDataColumn:ExistEditConditions()

bEditCondition

bEditConditionList

 


Page url: http://www.YOURSERVER.com/index.html?bdatacolumn_editcondition.htm