Behavior Changes for DataWindow Objects

The .NET and WPF environments affect the behavior of many DataWindow features at runtme.

The following table highlights some of the important changes to the runtime behavior of DataWindow features in WPF applications:

Feature PowerBuilder Classic behavior PowerBuilder .NET behavior
Alignment If a column is right aligned and is not wide enough to display all the text, the text at the left is not visible. If a column is right aligned and is not wide enough to display all the text, the text at the right is not visible.
Background color for columns
  • If the background color on a column is transparent, the color changes to black when the column gets focus.
  • If the background is a gradient, when it gets focus, the color appears solid.
  • If the background color on a column is transparent, the color remains transparent when column gets focus.
  • If the background is a gradient, it does not change when the column gets focus.
Band rendering
  • Detail band renders before the header and footer bands.
  • The detail band is truncated if there is not enough space to display the entire band.
  • The summary band may appear separate from the last detail row.
  • Header and footer bands render first. If their heights are large, they may obscure the detail band.
  • The summary band is truncated if there is not enough space to display the entire band.
  • The summary band and last detail row appear together.
Brushmode, Angle When the angle is within the ranges of 91-179 or 271-359, the height midpoint is the axis. When the angle is within the ranges of 91-179 or 271-359, the top left corner is the axis.
CanUndo and Undo behavior If data is modified in a column and does not lose focus, call CanUndo and it returns true, then call Undo and the data is restored.

Call CanUndo again, it returns true, then call Undo function, the data will be restored again.

If data is modified in a column and does not lose focus, call CanUndo and it returns true, then call Undo and the data is restored.

Call CanUndo function again, it returns false, then call Undo function, the data is not restored.

CodeTable property after editing data If you edit column data and then set the CodeTable property to no, text appears in the column. If you edit column data and then set the CodeTable property to no, the data is restored.
Data view changes update Preview view After editing content in the Data view and saving the changes, the Preview view does not display the edited content unless you close and reopen the DataWindow object. The Preview view displays the content you edited in the Data view after you save the changes.
EditMask Date fields If the user does not enter the full date, the system supplies the other values. If the user does not enter the full date, the date is not accepted and the field does not populate.
Disabling DataWindow control If the DataWindow control is disabled, there is no change in the appearance of the child controls. If the DataWindow control is disabled, the child controls are disabled and dimmed.
DropDown event behavior The first time a drop-down DataWindow is clicked, the DropDown event triggers and it opens. The second time it is clicked, the drop-down DataWindow closes without triggering the event.

If there is no data, the DropDown event triggers but the drop-down DataWindow does not appear.

The first time a drop-down DataWindow is clicked, it opens. The second time it is clicked, the drop-down DataWindow closes. This happens whether the drop-down DataWindow contains data.
Drop-down DataWindows If a drop-down DataWindow is opened, the MouseMove event may be triggered when you move the mouse. If a drop-down DataWindow is opened, the MouseMove event is not triggered when you move the mouse.
EditMask columns using code tables
  • When a Date, Time, DateTime, or String column has a value that is not in the code table, the column displays 00/00/00 or 00:00:00.
  • If the user enters a value that does not exist in the CodeTable, when the column loses focus, the data is not accepted.
  • If the user enters a value that exists in the CodeTable but in a format that does not match the code table, when the column gets focus, the value appears.
  • For numeric and decimal datatypes, if the value does not exist in the CodeTable, the value still appears. The mask is effective when inputing data.
  • If the value for a Date, Time, DateTime, or String column has a value that is not in the code table, the column displays nothing.
  • If the user enters a value that does not exist in the CodeTable, when the column loses focus, nothing appears.
  • If the user enters a value that exists in the CodeTable, when the column gets focus, the display value appears even if the input data format is not consistent with the data value format in the CodeTable.
  • For numeric and decimal datatypes, if the value does not exist in the CodeTable, the value still appears. The mask does not work when the user inputs data; when it loses focus, the mask works.
EditMask.Spin property If a column uses a CodeTable and initially has a spin control that is then disabled, the CodeTable value is not shown in the column. If a column uses a CodeTable and initially has a spin control that is then disabled, the CodeTable value appears in the column.
EditMask field in Properties view If you double-click the EditMask field where it is divided into segments (such as date or time fields), only the segment is highlighted after the double-click. Double-clicking in the EditMask field selects all of the content in this field.
Event sequence, Click and DoubleClick For a column control, the event sequence is click, click, double-click. If the control has focus or the double-click occurs on a non-column control, the event sequence is click, double-click. The events trigger sequence is always click, double-click, click.
Event sequence, Click and GetFocus When the DataWindow does not have focus and it is clicked, the event sequence is: GetFocus, Clicked. When the DataWindow does not have focus and it is clicked, the event sequence is: Clicked, GetFocus.
Event sequence, change of focus The event sequence for RowFocusChanging, RowFocusChanged, and ItemFocusChanged varies, depending on the operation.
  • When the DataWindow is reset before inserting a row, the event sequence is: RowFocusChanging, ItemFocusChanged, RowFocusChanged.
  • When inserting a row without resetting, the event sequence is: RowFocusChanging, RowFocusChanged, ItemFocusChanged.
The trigger sequence is always: RowFocusChanging, RowFocusChanged, ItemFocusChanged.
Event sequence, print events If Print is called first, the event sequence is: PrintStart, PrintPage, PrintEnd, and other evens.

If you call PrintCancel after Print, the DataWindow object prints. The Print function returns the value when the printing is complete.

PrintPage and PrintEnd can be triggered after other events that are triggered by the Print function.

If you call PrintCancel after Print, the DataWindow object does not print. The Print function is only used to prepare a print document and add a print job ot the print manager. You can cancel the print job if the printing is not complete.

Event sequence, retrieve and resize events The event sequence is: RetrieveStart, Resize, RetrieveEnd. The event sequence is: RetrieveStart, RetrieveEnd, Resize
Event sequence, scrolling with PageUp and PageDown The event sequence is: RowFocusChanging, ScrollVertical, RowFocusChanged. The event sequence is: RowFocusChanging, RowFocusChanged, ScrollVertical.
Export format The format of date and time columns uses a fixed format. The format of date and time columns uses the culture set for the runtime operating system.
Export Graph object
  • When the Graph object is exported with the header, the header value is (NONE)
  • XLS format is supported
  • When the Graph object is exported with the header, the header is the label text
  • XLS format is not supported
Format keywords for Date,Time, and Currency(7) datatypes Uses static masks: dd/mm/yyyy, hh:mm:ss:fff, $#,###.## and ($#,###.##). Uses masks based on the culture set for the runtime operating system.
GetText function If the EditMask edit style uses a code table:
  • If the EditMask is the same as the CodeTable value's format, GetText function return value uses a fixed format for each datatype.
  • If the EditMask is not the same as the CodeTable value's format and it uses a date, date/time, or time datatype, GetText returns null. For numeric and decimal datatypes, GetText returns data with no format.
If the EditMask edit style does not use a CodeTable:
  • For date, date/time, and time datatypes, the GetText function return value uses a fixed format for each datatype.
  • For numeric and decimal datatypes, GetText returns data with no formatting.
If the EditMask edit style uses a code table, the GetText return value uses the format that the code table value used.
If the EditMask edit style does not use a CodeTable:
  • For date, date/time, and time datatypes, the GetText function return value uses the same format as the EditMask.
  • For numeric and decimal datatypes, GetText returns the data with no formatting.
GraphCreate event During Retrieve, GraphCreate is triggered twice. During InsertRow, DeleteRow, and Update, GraphCreate is triggered once. Retrieve triggers GraphCreate once. InsertRow, DeleteRow, and Update do not trigger GraphCreate.
ItemError event If the user enters a value in an invalid format and ItemError returns 2, PowerBuilder Classic sets it to a random valid value. The ItemChanged and ItemFocusChanged events are triggered. When the user input is in an invalid format, PowerBuilder .NET changes it back to the original value. ItemChanged is not triggered and ItemFocusChanged is triggered.
KeyDown event Pressing the Alt key does not trigger the DataWindow's KeyDown event. Pressing the Alt key triggers the DataWindow's KeyDown event.
Mode expression function Mode calculates the most frequently occuring value for a column. Because of a new sorting algorithm, the value returned by Mode may be different.
Pen.Width property behavior The Pen.Width is always measured in pixel units. The Pen.Width uses the unit of measurement specified in the DataWindow.
Print function If the Print.FileName of a DataWindow or DataStore is not empty, then:
dw_1.Print(false,false) //silent print

prints to file or a physical printer, depending on the default printer

or

dw_1.Print(false,true) //show print dialog
  • if the default printer is a physical printer, it prints a hard copy of the file
  • if the default printer is a virtual printer, is saves a file (of that printer's type) with the name entered in the file dialog

When Print.FileName for a DataWindow or DataStore is not empty, either a silent print or show print dialog prints to an XPS file.

PrintToFile was removed from the printer setting for security reasons. The Print dialog displays so the user can confirm the printing operation. When there is no user interaction, the DataWindow or DataStore uses SaveAs XPS file.

PrintPage behavior When the return code is set to 1, the page is not printed. When the return code is set to 1, the page prints.
Prompt Before Printing property If Prompt Before Printing is selected, the Print Preferences dialog appears. Closing the Print Preferences dialog continues the print job. If Prompt Before Printing is selected, the Print dialog appears (and you can access the Print Preferences from there). Closing the Print dialog cancels the print job.
Protected columns
  • In a Grid, if a protected column is selected, it gains focus and then loses focus.
  • In other presentation styles, the selected column gets focus and does not lose focus.
Select a protected column and it does not get focus. The current row and column get focus.
Read only behavior When a read-only column gets focus, the cursor may appear. When a read-only column gets focus, the cursor does not appear.
Retrieve argument If the retrieve argument type is not correct, RetrieveStart and RetrieveEnd are not triggered. If the retrieve argument is not correct, retrieving the DataWindow triggers RetrieveStart and RetrieveEnd.
RichText column, bullets or numbering Setting the bullet or numbering does not change the column's indent. Setting the bullet or numbering changes the column's indent.
RichText column, edit data and set AutoHeight If a user enters data and does not accept the text, then sets the column's AutoHeight, the data is not restored. If a user enters data and does not accept the text, then sets the column's AutoHeight, the data is restored.
RichText column, setting font properties If text is not selected, and the cursor is placed in a word, any changes to the font properties affect only the cursor location. If the cursor is placed in the middle of a word and changes are made to the font properties, the changes will be made to the entire word.
RichText column, TextStyle status If the cursor is placed before text, the text's style may not display in the toolbar. The text's style will display when the cursor is placed before it.
RichText column, return character The return character is ignored in the EditChanged and ItemChanged events' data arguments. The return character is returned in the EditChanged and ItemChanges events' data arguments.
RichText column, select and delete content Use the mouse to select all the content in a RichText column from the end to the start and delete it, the data becomes an empty string. No return character is appended at the end. Use the mouse to select all the content in a RichText column from the end to the start (without selecting the final return character) and delete it, the data is not an empty string. If you do select and delete the final return character, it does return an empty string.
RichText column, set font property When the cursor is at the start or end of the input field, and the user sets the font property then clicks in the field, the font property applies. When the cursor is at the start or end of the input field, and the user sets the font property then clicks in the field, the font property does not apply.

When the control loses and regains focus, the style at the cursor position resets to the adjacent character's style.

RichText columns, where data is stored by TX control and displayed using MS RichText control The text is centered. The text is left-aligned.
RichText input fields
  • Copy and paste an input field, the pasted field looks like an input field but it does not actually access the data.
  • Copy and paste an input field into a text edit, just the text is copied.
  • Copy some of the text and paste it, only the selected text is pasted.
  • The input field can be partially selected with other text.
  • Copy and paste an input field, the pasted field is an actual input field that can retrieve and modify data.
  • Copy and paste an input field into a text editor, the input field changes to the format {name, value}.
  • Copy some of the text and paste it, the entire input field is pasted.
  • The input field cannot be partially selected with other text.
RichText DataWindow final character The final character is treated as an empty line. The final character is not treated as an empty line.
RichText DataWindow font properties When the user double-clicks the toolbar, the Font dialog appears and the user can set the font properties, including color. The Font dialog is not available. Use the toolbar to set all font properties, including color.
RichText DataWindow input fields
  • The color of the input field does not change when the content is selected.
  • Right-clicking on a field does not select it.
  • The color of the input field changes to gray when the content is selected.
  • Right-clicking on a field selects it.
RichText DataWindow, RichTextCurrentStyleChanged event
  • The event triggers at the same time whether the user selects left to right or right to left.
  • Setting the font in the toolbar does not trigger the event.
  • The event triggers at different times if the user selects left to right or right to left. If the user selects it quickly, the event may not trigger at all.
  • Setting the font in the toolbar triggers the event.
RichText DataWindow, SelectTextAll function The final paragraph marker character is not at the end of the TX control. The final paragraph marker is appended automatically when the MS RichTextBox loads content.
Selected text color When the user selects text, the highlight color is dark and the text turns white. When the user selects text, the highlight color is light and the text does not change color.