ObjectDCL Banner

Grid_SetItemStyle Method

Description

This method will set the editing style of a single cell.

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.
nRowIndex
Integer specifying row index.
nColIndex
Integer specifying column index.
nStyle
Integer specifying the new style to apply. The valid values are:
  • 0 - Decide at run time
  • 1 - Check Boxes
  • 2 - Option Buttons
  • 3 - Switchable Icons
  • 4 - Ellipses Buttons
  • 5 - Pick Buttons
  • 6 - Strings
  • 7 - AngleUnits
  • 8 - Integers
  • 9 - Units
  • 10 - UpperCase
  • 11 - LowerCase
  • 12 - Password
  • 13 - MultiLine
  • 14 - Currency
  • 15 - Date
  • 16 - Time
  • 17 - Percentage
  • 18 - DropDown
  • 19 - ArrowHeads
  • 20 - Acad Colors
  • 21 - TextStyle List
  • 22 - PlotStyle Names
  • 23 - PlotStyle Tables
  • 24 - Plotter List
  • 25 - Fonts
  • 26 - Drive List
  • 27 - Layer List
  • 28 - DimStyle List
  • 29 - ImageDrop List
  • 30 - AcadColor Cell
  • 31 - TrueColor Cell
  • 32 - LineWeight Cell
  • 33 - Linetype Cell
  • 34 - Directories
  • 35 - Files
  • 36 - Strings Combo
  • 37 - AngleUnits Combo
  • 38 - Integers Combo
  • 39 - Units Combo
  • 40 - UpperCase Combo
  • 41 - LowerCase Combo
nData1
Integer specifying the first optional style parameter.
nData2
Integer specifying the second optional style parameter.
sString
String specifying the optional style parameter.

Return Values

Returns the following according to the situation:

  • T when successful.
  • Nil if the control is not found, does not support this function or if there is no such row or column.

AutoLISP Syntax

The recommended convention is passing the control identifier directly:

CopyCode imageCopy Code
(Odcl_Grid_SetItemStyle 
		MyControlReference [as Reference]
		nRowIndex [as Integer]
		nColIndex [as Integer]
		nStyle [as Integer]
		[Optional] nData1 [as Integer]
		[Optional] nData2 [as Integer]
		[Optional] sString [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_SetItemStyle
		ProjectFile [as String]
		DialogName [as String]
		ControlName [as String]
		nRowIndex [as Integer]
		nColIndex [as Integer]
		nStyle [as Integer]
		[Optional] nData1 [as Integer]
		[Optional] nData2 [as Integer]
		[Optional] sString [as String])

Remarks

For the style: 3 - Switchable Icons, the last two arguments (nData1 and nData2) that must be passed in, identify the two images from the image list that are to be used.

For the style: 15 - Date, the last argument (nData1) that can be passed in is the identifying date format.  0 through 9 are the allowable arguments.

For the style: 16 - Time, the last argument (nData1) that can be passed in is the identifying time format.  0 through 5 are the allowable arguments.

For the style: 35 - Files Cell, the last argument (sString) that can be a string identifying the file extensions to look for. If not found, "dwg;dxf" will be assumed.

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

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

For example if you set the style 38 - Integers Combo, all the items to be added to the drop list must be as strings. You are responsible to ensure the correct text is added.

Applies For

EditableGrid.

Example

CopyCode imageCopy Code
; Update the text of the third row on the fourth column
(Odcl_Grid_SetItemStyle MyProject_MyForm_MyControl "Completed" 2 3)

See Also

Grid_GetItemCheck, Grid_GetItemData, Grid_GetItemImage, Grid_GetItemText, Grid_SetItemCheck, Grid_SetItemData, Grid_SetItemDropList, Grid_SetItemImage, Grid_SetItemText