You place DataWindow controls in a window or user object and then specify the DataWindow object you want to use within them to display and manipulate data in the window.
A DataWindow object allows users to display, manipulate, and update database or other information. You build DataWindow objects in the DataWindow painter.
For information about DataWindow objects, see the PowerBuilder Users Guide.
Obsolete functions
Several DataWindow control functions are described as obsolete,
which means that although the function operates as usual in this
release, it will be removed in a future release. You should replace
all use of these functions as soon as possible.
DataWindow property |
Datatype |
Description |
---|---|---|
String |
A description of the control and/or its purpose for use by accessibility tools such as readers for visually impaired users. |
|
String |
A label that briefly describes the control, such as the text in a button or the name of a menu item. |
|
AccessibleRole (enumerated) |
Describes what kind of user interface element the control is. |
|
Boolean |
Specifies whether the control has a border. Values are:
|
|
BorderStyle (enumerated) |
Specifies the border style of the control. Values are:
|
|
Boolean |
Specifies whether PowerBuilder moves the control to the top of the front-to-back order. |
|
ClassDefinition |
PowerObject |
An object of type PowerObject containing information about the class definition of the object or control. |
Boolean |
Specifies whether the Control Menu box displays in the control title bar. Values are:
|
|
String |
Specifies the name of the DataWindow object associated with the control. |
|
Boolean |
Specifies whether PowerBuilder puts the control automatically into Drag Mode. DragAuto has these boolean values:
|
|
String |
Specifies the name of the stock icon or the file containing the icon you want to display when the user drags the control (the ICO file). The default icon is a box the size of the control. When the user drags the control, the icon displays when the control is over an area in which the control can be dropped (a valid drop area). When the control is over an area that is not a valid drop area, the No-Drop icon displays. |
|
Boolean |
Specifies whether the control is enabled (can be selected). Values are:
|
|
Integer |
Specifies the height of the DataWindow control, in PowerBuilder units. |
|
Boolean |
Specifies whether a horizontal scroll bar displays in the control when all the data cannot be displayed at one time. Values are:
|
|
Boolean |
Specifies whether the split bar displays in the control. Values are:
|
|
String |
Specifies the name of the ICO file that contains the icon that displays when the DataWindow control is minimized. |
|
Boolean |
Scrolls the rows in the DataWindow control while the user is moving the scroll box. |
|
Boolean |
Specifies whether a Maximize Box displays in the DataWindow control title bar. Values are:
|
|
Boolean |
Specifies whether a Minimize Box displays in the DataWindow control title bar. Values are:
|
|
Object |
DWObject |
Used for the direct manipulation of objects within a DataWindow object from a script. These objects can be, for example, columns or text objects. |
Boolean |
Specifies whether the DataWindow control is resizable. Values are:
|
|
Boolean |
Specifies that characters should be displayed in right-to-left order. The application must be running on an operating system that supports right-to-left display. Values are:
|
|
Integer |
Specifies the tab value of the DataWindow control within the window or user object (0 means the user cannot tab to the control). |
|
String |
Specifies the tag value assigned to the DataWindow control. |
|
String |
Specifies the text that displays in the DataWindow control title bar. |
|
Boolean |
Specifies whether a title bar displays in the DataWindow control. The user can move the DataWindow control only if it has a title bar. Values are:
|
|
Boolean |
Specifies whether the DataWindow control is visible. Values are:
|
|
Boolean |
Specifies whether a vertical scroll bar displays in the control when not all the data can be displayed at one time. Values are:
|
|
Integer |
Specifies the width of the DataWindow control, in PowerBuilder units. |
|
Integer |
Specifies the X position (the distance from the left edge of the window), in PowerBuilder units. |
|
Integer |
Specifies the Y position (the distance from the top edge of the window), in PowerBuilder units. |
Some but not all DataWindow events have return codes that you can use to determine what action is taken after the event occurs. You set the return codes in a RETURN statement in the event script.
DataWindow event |
Occurs |
---|---|
When the user clicks a button. |
|
When the user clicks a button. This event occurs before the ButtonClicked event. |
|
When the user clicks between fields in the DataWindow control. Return codes:
|
|
When a node in a TreeView DataWindow has collapsed. |
|
Before a node in a TreeView DataWindow collapses. |
|
Immediately before the Open event occurs in the window. |
|
When a database error occurs in the DataWindow control. |
|
Immediately after the Close event occurs in the window. |
|
When the user double-clicks between fields in the DataWindow control. For a RichText presentation style DataWindow, when the user double-clicks in the text. |
|
When a dragged control is dropped on the DataWindow control. |
|
When a dragged control enters the DataWindow control. |
|
When a dragged control leaves the DataWindow control. |
|
When a dragged control is within the DataWindow control. |
|
When a user types in an edit control in the DataWindow control. |
|
When an error is found in a data or property expression for a DataWindow object. |
|
When a node in a TreeView DataWindow has expanded. |
|
Before a node in a TreeView DataWindow expands. |
|
Just before the DataWindow control receives focus (before it is selected and becomes active). |
|
When the user presses the F1 key or drags the context help button (question mark) from the title bar to a menu item or control. |
|
When a field in the DataWindow has been modified and loses focus (for example, the user presses Enter, the Tab key, or an arrow key, or clicks the mouse on another field within the DataWindow). Return codes:
|
|
When a field has been modified, the field loses focus (for example, the user presses Enter, Tab, or an arrow key, or clicks the mouse on another field), and the field does not pass the validation rules for its column. Return codes:
If the Return code is 0 or 1 (rejects the data), the field with the incorrect data regains the focus. |
|
When the current item in the control changes. |
|
When the DataWindow control loses focus (becomes inactive). |
|
When a Windows message occurs that is not a PowerBuilder event. |
|
When the printing of the DataWindow ends. |
|
Before each page of the DataWindow is formatted for printing. Return codes:
|
|
When the printing of the DataWindow starts. |
|
When the right mouse button is pressed on the control. For a RichText presentation style DataWindow, if PopUp Menu has been turned on, this event is not triggered when the right mouse button is pressed. |
|
When the user or a script resizes a DataWindow control. |
|
When the retrieval for the DataWindow is complete. |
|
After a row has been retrieved. Return codes:
|
|
When the retrieval for the DataWindow is about to begin. Return codes:
|
|
When the current row changes in the DataWindow. |
|
When the current row is about the change in the DataWindow. This event occurs before the RowFocusChanged event. |
|
When the user scrolls right or left in the DataWindow control with the Tab or arrow keys or the scroll bar. |
|
When the user scrolls up or down in the DataWindow control with the Tab or arrow keys or the scroll bar. |
|
After a Retrieve, Update, or ReselectRow function call and immediately before the SQL statement is submitted to the DBMS. The following return codes specify the action that takes place when the event occurs after an Update function call only:
|
|
When all the updates from the DataWindow to the database are complete. |
|
After an Update function call and just before changes in the DataWindow are sent to the database. Return codes:
|
|
Occurs when an error is returned for a DataWindow using the WSConnection object to connect to a Web service data source. |
DataWindow function |
Datatype returned |
Description |
---|---|---|
Integer |
Applies the contents of the DataWindow control’s edit control to the current item in the DataWindow buffer. |
|
Boolean |
Specifies whether the last edit can be undone with the Undo function. Applies to the edit control over the current row and column. Values are:
|
|
Integer |
Returns the number of categories in the specified graph in the DataWindow control. |
|
String |
Returns the name of the specified category in the specified graph in the DataWindow control. |
|
String |
Returns the name assigned to the DataWindow control. |
|
Integer |
Clears (deletes) the selected text in the edit control of the DataWindow control. For a RichText presentation style DataWindow, clears the selected text in the DataWindow. |
|
Integer |
Deletes all items from the value list associated with the specified column in the DataWindow control. |
|
Integer |
Copies the specified graph in the DataWindow control to the clipboard. |
|
Integer |
Copies the selected text in the edit control over the current row and column of the DataWindow control to the clipboard. For a RichText presentation style DataWindow, copies the selected text in the DataWindow control. |
|
String |
Returns the selected text, pictures, and input fields in a DataWindow control as a string with rich text formatting. Bitmaps and input fields are included in the string. |
|
Integer |
Creates a DataWindow object using the specified source code and replaces the DataWindow object in the specified DataWindow control with the new DataWindow object. |
|
Integer |
Displays the Crosstab Definition dialog box so the user can modify the definition of a crosstab DataWindow object during execution. |
|
Integer |
Cuts the selected text from the edit control over the current row and column of the DataWindow and stores it in the clipboard. For a RichText presentation style DataWindow, cuts the selected text in the DataWindow control. |
|
Long |
Returns the number of data points in the specified series in the specified graph in the DataWindow control. |
|
Integer |
Cancels a database retrieval in progress. |
|
Long |
Returns the error code (number) generated by a database error. Obsolete function DBErrorCode is an obsolete function and will be discontinued in a future release. Database error codes are now available as event arguments. |
|
String |
Returns a string containing the text of the error message generated by a database error. Obsolete function DBErrorMessage is an obsolete function and will be discontinued in a future release. Database error messages are now available as event arguments. |
|
Long |
Returns the number of rows that have been deleted from the DataWindow control but have not yet been updated in the associated database table. |
|
Integer |
Deletes the specified row from the DataWindow control. |
|
String |
Returns requested information about the structure of the DataWindow control. |
|
Integer |
Starts or ends the dragging of the DataWindow control. |
|
Integer |
Displays specific rows of the DataWindow control based on its current filter. |
|
Integer |
Returns the number of rows that are not visible because of the current filter. |
|
Long |
Syntax 1: Finds the next row in a DataWindow control in which data meets a specified condition. Syntax 2: For Rich Text presentation style Data Windows, finds the specified text in the control and highlights the text if found. You can specify search direction and whether to match whole words and case. |
|
Integer |
Returns the number of the specified category in the specified graph in the DataWindow control. |
|
Long |
Searches starting at a specified row for the first break for the specified group in the DataWindow control. |
|
Integer |
Finds the next occurrence of text in the control and highlights it, using criteria set up in a previous call of the Find function. This function applies only to DataWindow controls whose content has the RichText presentation style. |
|
Integer |
Identifies the required columns that the user has not filled. |
|
Integer |
Returns the number of the specified series in the specified graph in the DataWindow control. |
|
Integer |
Creates an HTML Form element containing columns for one or more rows. Also returns an HTML Style element containing style sheet information. |
|
Long |
Returns an EAServer result set from a PowerBuilder user object running as a component on EAServer. |
|
String |
Returns the string containing the band in which the pointer is currently located followed by a tab character (~t) and the number of the row associated with the band. |
|
Border (enumerated) |
Returns a Border enumerated datatype indicating the border style of the specified column in the DataWindow control. Values are:
|
|
Long |
Retrieves changes made to a DataWindow into a blob. This function is used primarily in distributed applications. |
|
Integer |
Stores in the specified variable the name of the child DataWindow in the specified column. |
|
Integer |
Returns the number of the column in the DataWindow control that the user clicked or double-clicked. |
|
Long |
Returns the number of the row in the DataWindow control that the user clicked or double-clicked. |
|
Integer |
Returns the number of the current column in the DataWindow control. |
|
String |
Returns the name of the current column in the DataWindow control. |
|
Integer |
Creates a reference to a context-specific instance of the specified service. |
|
Double |
Returns the value of the specified data in the specified series in the specified graph in the DataWindow control. See also GetDataValue. |
|
Integer |
Reports the percentage that a pie slice is exploded in a pie graph. |
|
Integer |
Determines whether the data at a given data point is labeled in a DirectX 3D graph. |
|
Integer |
Finds out the appearance of a data point in a graph. Each data point in a series can have individual appearance settings. There are different syntaxes, depending on what settings you want to check. |
|
Integer |
Obtains the transparency percentage of a series in a DirectX 3D graph. |
|
Integer |
Returns the value of the specified data in the specified series in the specified graph in the DataWindow control. |
|
String |
Returns the format used for display in the specified column of the DataWindow control. |
|
Long |
Retrieves the complete state of a DataWindow into a blob. This function is used primarily in distributed applications. |
|
Date |
Returns the date data in the specified row and column of the DataWindow control. |
|
DateTime |
Returns the datetime data in the specified row and column of the DataWindow control. |
|
Decimal |
Returns the decimal data in the specified row and column of the DataWindow control. |
|
Double |
Returns the numeric data in the specified row and column of the DataWindow control. |
|
dwItemStatus (enumerated) |
Returns the status of the item at the specified row and column location in the specified buffer. Values are:
|
|
String |
Returns the string data in the specified row and column of the DataWindow control. |
|
Time |
Returns the time data in the specified row and column of the DataWindow control. |
|
String |
Obtains the message text generated by a crosstab DataWindow object in the DataWindow control. Obsolete function GetMessageText is an obsolete function and will be discontinued in a future release. Message text is now available as an argument in a user-defined DataWindow event associated with the token pbm_dwnmessagetext. |
|
Long |
Returns the number of the first row that was modified in the specified buffer in the specified DataWindow control after the specified row. |
|
String |
Returns the string containing the name of the column or graphic control under the pointer in the DataWindow control, then a tab character (~t), and then the row number. |
|
PowerObject |
Returns a reference to the name of the parent object. |
|
Long |
Returns an integer containing the number of the current row in the DataWindow control. |
|
Long |
Gets the row number of a row in a DataWindow control from the unique row identifier associated with that row. |
|
Long |
Gets the unique row identifier of a row in a DataWindow control from the row number associated with that row. |
|
Integer |
Returns the number of the first selected row after the specified row number in the DataWindow control. |
|
Integer |
Obtains the series labelling for a DirectX 3D graph. |
|
Integer |
Finds out the appearance of a series in a graph. There are several syntaxes, depending on what settings you want. |
|
Integer |
Obtains the transparency percentage of a series in a DirectX 3D graph. |
|
String |
Returns the current SQL statement the DataWindow control is submitting to the database. Obsolete function GetSQLPreview is an obsolete function and will be discontinued in a future release. SQL syntax is now available as an event argument. |
|
String |
Returns the current SELECT statement for the DataWindow control. |
|
Long |
Retrieves the current status of the internal state flags for a DataWindow and places this information in a blob. This function is used primarily in distributed applications. |
|
String |
Returns the text in the edit control over the current row and column of the DataWindow control. |
|
Integer |
Returns the values in the DataWindow Transaction object. |
|
Integer |
Stores the number of the row that will be updated in a variable, and the dwBuffer enumerated datatype identifying the buffer containing the row in another variable. Obsolete function GetUpdateStatus is an obsolete function and will be discontinued in a future release. Update status is now available as an argument in the DataWindow control DBError and SQLPreview events. |
|
String |
Returns the validation rule used in the specified column of the DataWindow control. |
|
String |
Returns the specified item in the value list for the specified column. |
|
Integer |
Recalculates the breaks in the groups in the DataWindow control. |
|
Integer |
Makes the control invisible. |
|
Long |
Copies data from the clipboard to the DataWindow control. |
|
Long |
Copies data from a file to the DataWindow control. |
|
Long |
Copies data from a string to the DataWindow control. |
|
Integer |
Inserts a rich text format or plain text file into a DataWindow control. You use a function parameter to specify how the new content is added:
This function applies only to DataWindow controls whose content has the RichText presentation style. |
|
Long |
Inserts a new initialized row before the specified row in the DataWindow control. |
|
Boolean |
Returns true if the specified row in the DataWindow is selected; returns false if the row is not selected or is greater than the number of rows in the DataWindow control. |
|
Integer |
Determines the number of lines in an edit control that allows multiple lines. |
|
Long |
Returns the number of rows that have been modified in the DataWindow control but have not yet been updated in the associated database table. |
|
String |
Uses the specification contained in a string to modify the DataWindow control. |
|
Integer |
Moves the specified DataWindow control to a specified location. |
|
grObjectType |
Returns the number of the series the pointer is over and the number of the data point in the graph in the DataWindow control and identifies the object type. |
|
Integer |
Activates OLE for the OLE object in the specified row and column of the DataWindow control. |
|
Integer |
Inserts the contents of the clipboard into the edit control over the current row and column in the DataWindow control. |
|
Long |
Pastes rich text data from a string into a DataWindow control whose content has the RichText presentation style. |
|
Integer |
Returns the distance of the pointer from the left edge of the DataWindow control. |
|
Integer |
Returns the distance of the pointer from the top of the DataWindow control. |
|
Integer |
Syntax 1: Reports the insertion point’s position in the edit control over the current row and column of the DataWindow control. Syntax 2: Reports the line and column position of the insertion point or the start and end of selected text in a DataWindow control whose content has the RichText presentation style. |
|
Boolean |
Adds an event to the end of the message queue for the DataWindow control. |
|
Integer |
Sends the content of the DataWindow control to the current printer. This function has several syntaxes. |
|
Integer |
Cancels the print job and deletes the spool file (if any) when the content of the DataWindow control is sent to print. This function has two syntaxes. Use Syntax 1 when Syntax 1 of the Print function is used to send the content of the DataWindow control to the current printer. |
|
Integer |
Replaces the selected text in the edit control with the specified string. |
|
Integer |
Accesses the database to reselect all columns that can be updated and refreshes all timestamp columns in a row in the DataWindow control. |
|
Integer |
Clears all the data from a DataWindow control. |
|
Integer |
Deletes the data, the categories, or the series from a graph within a DataWindow object with an external data source. |
|
Integer |
Resets the color of a data point to the color specified for the series. |
|
Integer |
Stops the DataWindow control from using a programmer-defined Transaction object (thereafter, the DataWindow uses its internal Transaction object). |
|
Integer |
Resets the update flags for the DataWindow control. |
|
Integer |
Changes the width and height of the DataWindow control. |
|
Long |
Retrieves rows from the database for the DataWindow control. |
|
Long |
Returns the number of rows currently available in the DataWindow control (all the rows retrieved minus any deleted rows plus any inserted rows minus any rows that have been filtered out). |
|
Integer |
Copies a range of rows from one DataWindow control to another or from one buffer to another within a single DataWindow control. |
|
Integer |
Discards a range of rows. The rows cannot be restored unless retrieved from the database. |
|
Integer |
Clears a range of rows from a DataWindow control and inserts the rows in another DataWindow control or another buffer of the same DataWindow control. |
|
Integer |
Saves the data represented in the specified graph in the DataWindow control to the specified file, in the specified format. |
|
Integer |
Saves the content of the DataWindow control to the specified file, in the specified format, with or without column headings at the beginning. |
|
Long |
Saves the content of a DataWindow into a standard ASCII text file. |
|
Integer |
Scrolls the edit control of a DataWindow control in the specified direction the specified number of lines. |
|
Long |
Syntax 1: Scrolls forward by the number of rows showing in the DataWindow (when the DataWindow control contents does not have the RichText presentation style). Syntax 2: Scrolls to the next page of the document in a DataWindow control whose content has the RichText presentation style. |
|
Long |
Scrolls the DataWindow control to the next row. ScrollNextRow changes the current row but not the current column. |
|
Long |
Syntax 1: Scrolls backward by the number of rows showing in the DataWindow (when the DataWindow control content does not have the RichText presentation style). Syntax 2: Scrolls to the prior page of the document in a DataWindow control whose content has the RichText presentation style. |
|
Long |
Scrolls to the previous row. The ScrollPriorRow function changes the current row in the DataWindow control but does not change the current column. |
|
Integer |
Causes the control to scroll to the specified row. ScrollToRow changes the current row in the DataWindow control but does not change the current column. |
|
Integer |
Reports the total number of characters and spaces (length) in the selected text in the edit control over the current row and column. |
|
Integer |
Reports the line number in the edit control over the current row and column. |
|
Integer |
Reports the starting position in the edit control over the current row and column. |
|
String |
Reports what text (if any) is selected in the edit control over the current row and column of the DataWindow control. |
|
Integer |
Selects or deselects the specified row in the DataWindow control. |
|
Integer |
Syntax 1: Selects text in the edit control of a DataWindow control (other than one whose content is in the RichText presentation style). You specify where the selection begins and how many characters to select. Syntax 2: Selects text beginning and ending at the specified line and character positions in a DataWindow control whose content is in the RichText presentation style. |
|
Integer |
Selects all the content of a DataWindow control with the RichText presentation style. |
|
Integer |
Selects the line containing the insertion point in a DataWindow control with the RichText presentation style. |
|
Integer |
Selects the word containing the insertion point in a DataWindow control with the RichText presentation style. |
|
Integer |
Returns the number of series in the specified graph in the DataWindow control. |
|
String |
Returns the name of the specified series in the specified graph in the DataWindow control. |
|
Integer |
Defines the action a DataWindow control takes following an event. Obsolete function SetActionCode is an obsolete function and will be discontinued in a future release. You now set return codes in a return statement in the event script. |
|
Integer |
Sets the border style of the specified column in the DataWindow control. |
|
Long |
Applies changes captured with GetChanges to a DataWindow. This function is used primarily in distributed applications. |
|
Integer |
Makes the specified column the current column in the DataWindow control. |
|
Integer |
Explodes a pie slice in a pie graph. |
|
Integer |
Sets the series label for a DirectX 3D graph. |
|
Integer |
For the specified data point in the specified series in the specified graph in the DataWindow control: Syntax 1: Sets the data point’s color. Syntax 2: Sets the line style and width for the data point. Syntax 3: Sets the fill pattern or symbol for the data point. |
|
Integer |
Sets the transparency percentage for a data point in a series in a DirectX 3D graph. |
|
Integer |
Sets the height of each row in a specified range. |
|
Integer |
Defines the filter criteria for the DataWindow control. The actual filtering is performed by the Filter function. |
|
Integer |
Sets focus to the DataWindow control. |
|
Integer |
Sets the display format for the specified column of the DataWindow control. |
|
Long |
Applies the contents of a DataWindow blob retrieved by GetFullState to a DataWindow. This function is used primarily in distributed applications. |
|
Integer |
Accepts action and context information about user interaction with the Web DataWindow client control in a Web browser so that newly generated HTML can reflect any requested changes. |
|
Integer |
Sets the value of the specified row and column of the specified DataWindow control. |
|
Integer |
Sets the status of a row in a specified column of the DataWindow control in the specified buffer. |
|
Integer |
Syntax 1: Specifies whether the DataWindow control always displays on top in the front-to-back order within the window. Syntax 2: Moves an object within the DataWindow to another band or changes the front-to-back order of objects within a band. |
|
Integer |
Controls automatic redrawing of the DataWindow control after each change in its properties or contents. |
|
Integer |
Makes the specified row the current row in the DataWindow control. |
|
Integer |
Sets the current row indicator for the DataWindow control. |
|
Integer |
Sets the series label for a DirectX 3D graph. |
|
Integer |
For the specified series in the specified graph in the DataWindow control: Syntax 1: Sets the series’ color. Syntax 2: Sets the linestyle and width. Syntax 3: Sets the fill pattern or symbol for data markers in the series. Syntax 4: Specifies that the series is an overlay. |
|
Integer |
Defines the sort criteria for the DataWindow control. The actual sorting is performed by the Sort function. |
|
Integer |
Sets the transparency percentage of a series in a DirectX 3D type graph. |
|
Integer |
Sets the current SQL statement for the DataWindow control. |
|
Integer |
Changes the current SELECT statement for the DataWindow control. |
|
Integer |
Changes the tab value of the specified column in the DataWindow control. |
|
Integer |
Replaces the text in the edit control at the current row and column of the DataWindow control with the specified text. |
|
Integer |
Sets values in the DataWindow control’s internal Transaction object. |
|
Integer |
Sets the Transaction object for the DataWindow control and provides control over the transaction, including the ability to commit from a script. |
|
Integer |
Changes the validation rule used for the specified column of the DataWindow control. |
|
Integer |
Sets the value of the specified item in the value list or the code table of the specified column of the DataWindow control. |
|
Integer |
Causes a DataWindow control to use a programmer-specified connection object. The connection object provides the information necessary for communicating with a Web service data source. |
|
Integer |
Shares data between a primary DataWindow control and a secondary DataWindow control. |
|
Integer |
Turns off sharing for the DataWindow control. If that control is the primary DataWindow control, all secondary DataWindow controls are disconnected and their DataWindow objects no longer contain data. |
|
Integer |
Makes the DataWindow control visible. |
|
Integer |
In a RichText presentation style DataWindow control, displays the panels for editing the header and footer or hides the panels and returns to editing the main text. |
|
Integer |
Sorts the rows of the DataWindow control based on its current sort criteria. |
|
String |
Reports information about the edit control over the current row and column. |
|
Integer |
Triggers a specified event in the DataWindow control and executes the script for the event. |
|
Object |
Returns the type of the control. |
|
Integer |
Cancels the last edit in the edit control over the current row and column. |
|
Integer |
Sends to the database all inserts, deletes, and updates of the DataWindow control. |