|
|
|
SftTree.StartEdit Method |
Starts editing the specified cell using an edit control.
Deprecated - Provided for compatibility with earlier versions
only - See Cell Editing
This method continues to be used with Internet Explorer as it does not support
the new cell editing mechanisms introduced with SftTree/OCX 7.0.
Syntax
VB.NET |
object.StartEdit(ByVal ItemIndex As Integer, ByVal ColIndex As Short) |
||
VB |
object.StartEdit(ByVal ItemIndex As Long, ByVal ColIndex As Integer) |
||
C#.NET |
void object.StartEdit(int ItemIndex, short ColIndex); |
||
VC++ |
HRESULT object->StartEdit(long ItemIndex, short ColIndex); |
||
C |
HRESULT object->raw_StartEdit(long ItemIndex, short ColIndex); |
||
Delphi |
procedure object.StartEdit(ItemIndex : Integer, ColIndex : Smallint); |
object
A SftTree object.
ItemIndex
The zero-based item index. The combination of ItemIndex and ColIndex describes an individual cell.
ColIndex
The zero-based column number. The combination of ItemIndex and ColIndex describes an individual cell.
Comments
Deprecated - Provided for compatibility with earlier versions
only - See Cell Editing
This method continues to be used with Internet Explorer as it does not support
the new cell editing mechanisms introduced with SftTree/OCX 7.0.
The StartEdit method starts editing the specified cell using an edit control.
An edit control is displayed in the cell specified by ItemIndex and ColIndex. If the cell is not currently displayed, it is scrolled into view first. The edit control is initialized with the current cell text. The user can enter text using the keyboard. The StartCombo method offers selection without data entry. The StartComboEdit method allows data entry and selection.
If the column where the cell is located has the style ColumnStyle colstyleSftTreeMultiline (Column.CellMultiline property) and the Items.Lines property is set to a value greater than one line per item, the edit control allows multi-line data entry. A new-line character (CR-LF) can be entered by pressing the CONTROL and ENTER key at the same time. A vertical scroll bar is also added if needed.
The ItemEditFont property can be used to define the font used for cell editing. Using the CellEditStyle property, the combo box control's height can be controlled.
Use the CellEditLimit property to limit the allowable input to a certain number of characters. The SetCellEditSelection method can be used to select (highlight) all or portions of the text in the control.
There are two methods to handle cell editing events based on the CellEventHandling property:
CellEventHandling = False
If the user clicks a mouse button outside of the cell being edited or presses the TAB or ENTER key, the AfterEdit event is generated. This allows the application to perform input validation and other cleanup processing. If Cancel = False, the text selected replaces the cell's text. If Cancel = True, cell editing is not ended.
If the user presses the ESCAPE key, cell editing is ended and the original cell text is restored. An AfterEdit event is not generated. Any data the user entered or selected is lost.
Once cell editing has ended (or was aborted by the user), the PostEdit event is generated.
CellEventHandling = True
If the user clicks a mouse button outside of the cell being
edited, the AfterEdit event is generated. This allows the application to
perform input validation and other cleanup processing. If Cancel
= False, the text selected replaces the cell's text. If Cancel =
True, cell editing is not ended.
The ENTER or TAB keys do not end cell editing and must be handled by the
CEKeyDown or CEKeyPress event. Using these events, an application can
implement cell motion, moving from one cell to the next in response to
keystrokes.
If the user presses the ESCAPE key, cell editing is ended and the original cell text is restored. An AfterEdit event is not generated. Any data the user entered or selected is lost.
Once cell editing has ended (or was aborted by the user), the PostEdit event is generated.
See Also SftTree Object | Object Hierarchy