Objective Grid: Disabling cells

Article ID: 380
Last updated: 27 Apr, 2018
Article ID: 380
Last updated: 27 Apr, 2018
Revision: 3
Views: 1856
Posted: 09 Jan, 2001
by Meltreger B.
Updated: 27 Apr, 2018
by Meltreger B.

Problem

 


How can I disable a cell so that the user cannot click into the cell at all? Also when the user navigates through the grid disabled cells should be skipped.

 

 


Cause

 


 

 


Action

 


You can disable cells with SetEnabled(FALSE);

It is not possible to position the current cell onto a disabled cell. When the user navigates with arrow keys through the grid, disabled cells will be skipped. When the user clicks with the mouse into a disabled cell, nothing will happen.

It is recommended that you also set disabled cells to read-only. Otherwise the user can select a range of cells and press DELETE to clear all cells in the selected range.

Example:

SetStyleRange(CGXRange(1,1,CAL_ROWS,CAL_COLS),
CGXStyle( )
.SetEnabled(FALSE)
.SetReadOnly(TRUE)
.SetFont(CGXFont( ).SetBold(TRUE).SetSize(10))
.SetInterior(RGB(192,192,192))
.SetHorizontalAlignment(DT_CENTER)
.SetVerticalAlignment(DT_VCENTER)
);

This article was:   Helpful | Not helpful
Report an issue
Article ID: 380
Last updated: 27 Apr, 2018
Revision: 3
Views: 1856
Posted: 09 Jan, 2001 by Meltreger B.
Updated: 27 Apr, 2018 by Meltreger B.

Others in this category