RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TBaseDataSetAdapterField.GetViewMode Method

Returns a string value that indicates what function a control that represents this field should perform.

Pascal
function GetViewMode(const AAdapterMode: string): string;
C++
__fastcall AnsiString GetViewMode(const AnsiString AAdapterMode);

GetViewMode implements the ViewMode property of this adapter field. The ViewMode property can be used in server-side script to determine an appropriate control for the field's value. 

AAdapterMode indicates the current mode of the parent dataset adapter. It is one of the following values:

Value 
Mode 
The HTML control is used for 
Insert  
amInsert  
Providing a field value on a newly inserted record.  
Edit  
amEdit  
Modifying an existing field value.  
Browse  
amBrowse  
Read-only viewing of an existing field value.  
Query  
amQuery  
Entering a value to use for the field in a generated query.  

GetViewMode returns one of the following strings:

Value 
Meaning 
Input  
Display the adapter field as an input field, by default use the style returned by the GetInputStyle method.  
Display  
Display the adapter field as a read-only field, by default use the style returned by GetDisplayStyle.  
ToggleOnAccess  
Display as an input field if the end-user has modify rights, otherwise displays as a read-only field.  

Note: Although GetViewMode is not a virtual method, it uses the virtual GetViewModeType method to determine what value to return. To change the way the adapter field determines the view mode, override the GetViewModeType method.
 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!