Edit Column Properties

Top  Previous  Next

Basic Properties

ColumnExpression

This property defines the name of the database column in the table to be edited.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
     
     
   ... 
  </EditColumns> 
</DNL:DbNetEdit>

Run Sample

Label

Defines the text label displayed against the column. Defaults to database column name.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="UnitPrice" Label="Unit Price"/> 
    <DNL:EditColumn ColumnExpression="Qty" Label="Quantity"/> 
   ... 
  </EditColumns> 
</DNL:DbNetEdit>

Run Sample

PrimaryKey

At least one column must be designated as a PrimaryKey. For multi-part primary keys every column that constitutes the key must have the PrimaryKey property set. In many cases DbNetEdit is able to automatically detect that a column is a PrimaryKey and will set this property automatically.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="CustomerID" PrimaryKey="true"/> 
   ... 
  </EditColumns> 
</DNL:DbNetEdit>

Run Sample

Additional Properties

Audit

Enables tracking of the date and the user that  changes made to the column. Possible values are None, Summary and Detail. In Summary mode only the date/user of the last change to the column is recorded, in Detail mode all changes to the record are recorded including the previous value of the column and can be viewed in the Audit History dialog.

Run Sample

AutoIncrement

Indicates that the column value is auto-incrementing and therefore read-only. In the case of some columns such as SQL Server Identity columns this property is set automatically.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="id" Label="Id" AutoIncrement="true"/> 
    ... 
  </EditColumns> 
</DNL:DbNetEdit> 

Browse

Indicates that the column should be used in the browse list. The browse list is only enabled if at least one column has the browse property set to true.

Run Sample

Culture

The culture property allows the default culture derived from the browser language to be overridden for a particular column. For example if a column represents a dollar amount you can force the value to be formatted as a dollar amount irrespective of the default culture.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="OrderDate" Culture="en-US" Format="MMM yy"/>
    ... 
  </EditColumns> 
</DNL:DbNetEdit> 

Display

Indicates that an edit field is or is not visible. The default is true. A column that has it's Display property set to false is still created and it's value can still be accessed on the client via the client-side getInputControl method

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="Region" Edit="false"/> 
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

Run Sample

EditControlType

The EditControlType property allows you to manually specify the type of control used to edit the database value. A default value is assigned based on the type and size of the database column. Possible values are listed here. For example, an EditControlType of Html will make the editor an HTML Editor rather than the default Text editor for a text column.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="Notes" EditControlType="Html"/> 
    ... 
  </EditColumns> 
</DNL:DbNetEdit> 

Run Sample

ForeignKey

Indicates that the column is acting as a foreign key in a linked child form. A ForeignKey column is paired with a PrimaryKey column in the parent control in order to establish the relationship between the 2 controls.

<DNL:DbNetEdit 
  FromPart="Orders"
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="CustomerID" Display="false" ForeignKey="true" />
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

Run Sample

Format

Specifies a format mask for a date-time or numeric value.  Values are the standard .NET date-time and numeric formatting strings. Use the EditFormat property to specify a distinct format string for the editable value. By default, formatting uses the culture indicated by the browser language (or server culture). You can specify the culture for formatting a particular column using the Culture property.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="OrderDate" Format="MMM yy"/>
    ... 
  </EditColumns> 
</DNL:DbNetEdit> 

Run Sample

InitialValue

Supplies an initial default value for a column when adding a new record

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="TitleOfCourtesy" InitialValue="Mr"/>
    ... 
  </EditColumns> 
</DNL:DbNetEdit> 

Run Sample

InsertReadOnly

Specifies that the column cannot be edited when a record is being added.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="OrderDate" InsertReadOnly="true"/>
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

Run Sample

IsBoolean

Specifies that the column should behave like a boolean(bit) column (accepting only true/false). Some databases do not have an dedicated boolean type and with this property you can make a different data type such as small integer act like a boolean database type.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="Discontinued" IsBoolean="true"/>
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

Lookup

The Lookup property is used to convert a value to/from its descriptive value typically held in a separate database table. The Lookup property is specified as an SQL statement that selects 2 columns. The first column is the foreign key column that is matched against the column value and the second value is the descriptive value. The Lookup property is used when displaying a grid value, searching against the value and editing the value.  If only a single column is specified the column is used as the value and descriptive text. If a lookup is searchable ( i.e EditControlType is AutoCompleteLookup or TextBoxSearchLookup) the second column (and any subsequent columns) will be searched against using the supplied user token.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="CategoryID" Required="true" Lookup="select CategoryID, CategoryName from Categories" /> 
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

Run Sample

The way a lookup is implemented can be controlled by setting the EditControlType property to one of the following values DropDownList (default), TextBoxLookup, AutoCompleteLookup, TextBoxSearchLookup, ListBox or RadioButtonList

Run Sample

A Lookup can also be defined using a string of values defined in JSON array format.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
     
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="Region" Lookup="['AK','CA','ID','MT','NM','OR',WA','WY']"/> 
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

Run Sample

LookupSearchMode

The LookupSearchMode property is used to indicate if the search (via the search dialog) should be made directly against the column value or indirectly against the descriptive text as defined by the Lookup property. Possible values are SearchText or SearchValue.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="CustomerID" LookupSearchMode="SearchText" Lookup="select CustomerID, CompanyName from Customers" />
    ... 
  </EditColumns> 
</DNL:DbNetEdit> 

MaxThumbnailHeight

Specifies the maximum height of an image associated with a column when displayed as a thumbnail in the grid. The width of the image is scaled in proportion to the height.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

Run Sample

PlaceHolder

Specifies text for the edit input placeholder

Run Sample

ReadOnly

Indicates if a field is read-only in both insert and update mode. The column is displayed in the edit dialog but the value cannot be altered.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="Discontinued" ReadOnly="true" />
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

Run Sample

Required

When set to true then a value must be entered when editing the value

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="LastName" Required="true" />
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

Run Sample

Search

Indicates if a column is searchable (via the search dialog). Default is true.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="LastName" Search="false" />
    ... 
  </EditColumns> 
</DNL:DbNetEdit> 

SearchLookup

Specifies a lookup for the column in the search dialog when different from the Lookup property.

SequenceName

Specifies the name of an Oracle sequence or Firebird generator that is used to generate the primary key value.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="EmployeeID" SequenceName="EmployeeIDSequence" />
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

SimpleSearch

Indicates that a column is eligible to be searched against with the Simple Search dialog.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="LastName" Search="false" SimpleSearch="true" />
    ... 
  </EditColumns> 
</DNL:DbNetEdit> 

SpellCheck

Indicates that a spell checking should be enabled for this column in the form. To enable for all column use the edit SpellCheck property.

 

Style

Specifies CSS style attributes that are applied to the column when displayed in the grid.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="UnitPrice" Style="background-color:gold;" /> 
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

Run Sample

ToolTip

Specifies a tooltip for the edit control that will be displayed when the mouse hovers over the control

<DNL:DbNetGrid 
  ...> 
  <EditColumns> 
    ...
    <DNL:GridColumn ColumnExpression="UnitPrice" ToolTip="Please enter the net price (without tax)" /> 
    ... 
  </EditColumns> 
</DNL:DbNetGrid> 

Run Sample

Unique

If set to true the column value will be checked for uniqueness when edited. Can be set on more than one column in which case the combination of column values must be unique. Any column that has the Unique property set will automatically have the Required property set to true.

Run Sample

UpdateReadOnly

Specifies that the column cannot be edited when a record is being amended.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="OrderDate" UpdateReadOnly="true"/>
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

Run Sample

UploadExtFilter

Specifies a comma separated inclusive list of valid file extensions that can be selected for uploading.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="Photo" UploadExtFilter="jpg,jpeg,gif,bmp,png" MaxThumbnailHeight="60" />
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

Run Sample

UploadMaxFileSize

Specifies the maximum size in KB of a file that can be uploaded.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="Photo" UploadMaxFileSize="200" />
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

[****]
UploadOverwrite

Indicates if an existing file can be overwritten when uploading a new file.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="FilePath" UploadOverwrite="true" />
    ... 
  </EditColumns> 
</DNL:DbNetEdit>

UploadRootFolder

If a column is storing the path to an uploaded file then the UploadRootFolder must be specified to indicate where on the server the uploaded files should be saved.

<DNL:DbNetEdit 
  ...> 
  <EditColumns> 
    ...
    <DNL:EditColumn ColumnExpression="FilePath" UploadRootFolder="Upload Files" />
    ... 
  </EditColumns> 
</DNL:DbNetEdit> 

Run Sample

 

Width

Specifies the width of an edit control where applicable

<DNL:DbNetGrid 
  ...> 
  <EditColumns> 
    ...
    <DNL:GridColumn ColumnExpression="ProductName" Width="400px" />
    ... 
  </EditColumns> 
</DNL:DbNetGrid>