ObjectDCL Banner

Grid_InsertString Method

Description

This method inserts a new row in the specified position of a EditableGrid control and fills in each of the cells using a single string. The string is to have a separator that identifies what parts of the strings belong in which cell. If the sSeperator argument of this function is not specified, "" will be assumed.

Parameters

MyControlReference
Reference to the control in the form of MyProject_MyForm_MyControl.
ProjectFile
String identifying the project as it was passed in LoadProject.
DialogName
String identifying the dialog by name.
ControlName
String identifying the control by name.
nInsertRowIndex
Integer specifying the index where to insert the new row.
sValues
String specifying the values for each cell.
sSeparator
String specifying the separator between each value.

Return Values

Returns the following according to the situation:

  • Integer identifying the index of the new row.
  • Nil if the control is not found or does not support this function.

AutoLISP Syntax

The recommended convention is passing the control identifier directly:

CopyCode imageCopy Code
(Odcl_Grid_InsertString 
		MyControlReference [as Reference]
		nInsertRowIndex [as Integer]
		sValues [as String]
		[Optional] sSeparator [as String])

An alternative convention is to identify the control by providing the project file, the dialog name and the control name:

CopyCode imageCopy Code
(Odcl_Grid_InsertString
		ProjectFile [as String]
		DialogName [as String]
		ControlName [as String]
		nInsertRowIndex [as Integer]
		sValues [as String]
		[Optional] sSeparator [as String])

Remarks

This functions does not give you the ability to specify image icons to be display in any cell, the function Grid_SetItemImage should be used after this function is called to assign image icons in the cells.

The style of the cell or column only governs the behavior of the cell and what happens when the user clicks on the cell.

For exampleb if you set the style 33 - Linetype Cell, the current selection for the linetype must be correctly set in the Grid_AddString or Grid_AddRow functions. The item may not be changed to correctly display one of the listed items.

Applies For

EditableGrid.

Example

CopyCode imageCopy Code
; Insert a new row at the beginning of the list
(setq rValue (Odcl_Grid_InsertString MyProject_MyForm_MyControl
	0 "Debit Card,Cash-less method of payment" ","))

See Also

Grid_AddString