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 |
|
|
Band rendering |
|
|
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 |
|
|
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.
|
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 |
|
|
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 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:
|
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
|
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 |
|
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 |
|
|
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 |
|
|
RichText DataWindow, RichTextCurrentStyleChanged 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. |