WebGridCell Properties
Position | Description Gets the position of the cell from its collection. ValueType integer Default Value - |
Text | Description Gets or sets the text that will be displayed in cell. ValueType string Default Value - |
Tag | Description Gets the custom data for the cell object. ValueType string Default Value "" |
Value | Description Gets the cell's value. ValueType object Default Value - |
Column | Description Gets the column object to which this cell belongs. ValueType object (WebGridColumn) Default Value - |
DataChanged | Description Returns whether cell's data has been changed. ValueType boolean Default Value false |
ForceNoEdit | Description Determines whether this cell will be forced not to allow editing. ValueType boolean Default Value false |
Name | Description The name of the item in its collection. ValueType string Default Value - |
CellElement | Description Gets the HTML element of this cell object. ValueType object (HTML element) Default Value - |
Row | Description Returns the row object to which this cell belongs. ValueType object (WebGridRow) Default Value - |
Table | Description Returns the table object to which this cell belongs. ValueType object (WebGridTable) Default Value - |
Grid | Description Returns the grid object to which this cell belongs. ValueType object (WebGrid) Default Value - |
Modified | Description Represents whether this cell has been modified (dirty). ValueType boolean Default Value false |
OldValue | Description Represents the cell value before the cell is modified. ValueType object Default Value "" |
OldText | Description Represents the cell text before the cell is modified. ValueType string Default Value "" |
ContentMode | Description Indicates whether to treat the cell text as HTML content or plain text. ValueType string Default Value "Text" |
Value | Description Represents the value of the cell. ValueType object Default Value - |
WebGridCell Methods
GetElement |
Description Gets the HTML element of this cell. Parameters -
Remarks Return Value
Samples
function ObtainCell() |
IsForeignColumn |
Description Returns true if the cell is in a foreign key column. This method is available only for the cell in a child table, meaning that the grid must be in Hierarchical mode. Parameters
Remarks Return Value
Samples
function IsForeignCell()
{ var grid = ISGetObject("WebGrid1"); if (grid.GetSelectedObject() == null) { alert("Please select a child row."); return; } var row = grid.GetSelectedObject().GetRowObject(); if (row.Type == "Record" && row.SubTable != null) { var cell = row.GetCell("CustomerID"); var strXml = cell.SubTable.GetConstraintXml(); alert("The cell is in a foreign column: " + cell.IsForeignColumn(strXml)); } else alert("Please select a child row."); } |
IsActive |
Description Returns a value that indicates whether the cell is in active edit mode. Parameters -
Remarks Return Value
Samples
function IsCellActive()
{ var grid = ISGetObject("WebGrid1"); if (grid.GetSelectedObject() == null) { alert("Please select a row."); return; } var row = grid.GetSelectedObject().GetRowObject(); if (row.Type == "Record") { var cell = row.GetCell("CompanyName"); alert( cell.IsActive()); } else alert("Please select a Record Row"); } |
GetParentKeyValue |
Description Gets the key value of the cell's parent row. This method is available only for the cell in a child table, meaning that the grid must be in Hierarchical mode. Parameters
Remarks Return Value
Samples
function ParentKeyValue()
{ var grid = ISGetObject("WebGrid1"); if (grid.GetSelectedObject() == null) { alert("Please select a child row."); return; } var row = grid.GetSelectedObject().GetRowObject(); if (row.Type == "Record" && row.SubTable != null) { var cell = row.GetCell("CustomerID"); var strXml = cell.SubTable.GetConstraintXml(); alert("The cell's parent key value: " + cell.GetParentKeyValue(strXml)); } else alert("Please select a child row."); } |
SetText |
Description Sets the text of this cell. Parameters
Remarks - Return Value
Samples
function SetText()
{ var grid = ISGetObject("WebGrid1"); if (grid.GetSelectedObject() == null) alert("Please select a row."); return; var row = grid.GetSelectedObject().GetRowObject(); var cell = row.GetCell("ProductName"); if (row.Type == "Record") cell.SetText('Test', true); else alert("Please select a Record Row"); } |
SetValue |
Description Sets the value of this cell. Parameters
Remarks - Return Value
Samples
function SetValue()
{ var grid = ISGetObject("WebGrid1"); if (grid.GetSelectedObject() == null) alert("Please select a row."); return; var row = grid.GetSelectedObject().GetRowObject(); var cell = row.GetCell("ProductName"); if (row.Type == "Record") cell.SetValue('Test'); else alert("Please select a Record Row"); } |
SetForceNoEdit |
Description Forces this cell not to allow editing. Parameters
Remarks - Return Value
Samples
function SetNoEdit()
{ var grid = ISGetObject("WebGrid1"); if (grid.GetSelectedObject() == null) alert("Please select a row."); return; var row = grid.GetSelectedObject().GetRowObject(); var cell = row.GetCell("ProductName"); if (row.Type == "Record") cell.SetForceNoEdit(true); else alert("Please select a Record Row"); } |
Select |
Description Selects this cell. Parameters - Remarks - Return Value
Samples
function SelectCell()
{ var grid = ISGetObject("WebGrid1"); if (grid.GetSelectedObject() == null) { alert("Please select a row."); return; } var row = grid.GetSelectedObject().GetRowObject(); if (row.Type == "Record") { var cell = row.GetCell("CompanyName"); cell.Select(); } else alert("Please select a Record Row"); } |
SetChanges |
Description Change the text and value of this cell. Parameters text The new text to be set. value The new value to be set. This parameter is optional, and only useful for valuelist column. Remarks - Return Value
Samples
function SelectCell()
{ var grid = ISGetObject("WebGrid1"); if (grid.GetSelectedObject() == null) { alert("Please select a row."); return; } var row = grid.GetSelectedObject().GetRowObject(); if (row.Type == "Record") { var cell = row.GetCell("CompanyName"); cell.Select(); } else alert("Please select a Record Row"); } |