WebGridTable Properties
Name | Description The WebGridTable name. ValueType string Default Value - |
Grid | Description Gets the WebGrid object that owns this table. ValueType object ( WebGrid ) Default Value - |
IsRootTable | Description Returns whether the object is root table. ValueType Boolean Default Value - |
ParentTable | Description Returns the parent table of this object. ValueType WebGridTable Default Value - |
HasChildTable | Description Returns whether the object has child tables. ValueType Boolean Default Value - |
TableLevel | Description Returns the deep level of the current object from Hierarchy structure. ValueType int Default Value - |
Position | Description Returns the position of the object based on the Collection that owns this object. ValueType int Default Value - |
AllowAddNew | Description Specifies whether to allow user to add new rows. ValueType string Default Value - |
AllowColumnSizing | Description Specifies whether to allow user to resize the columns. ValueType string Default Value - |
AllowColumnMove | Description Specifies whether to allow user to move the columns. ValueType string Default Value - |
AllowEdit | Description Specifies whether to allow user to edit and modify data. ValueType string Default Value - |
AllowDelete | Description Specifies whether to allow user to delete data from within WebGrid. ValueType string Default Value - |
AllowFilter | Description Specifies whether to allow user to filter the rows from within WebGrid. ValueType string Default Value - |
AllowSelectColumns | Description Specifies whether to allow user to select columns from within WebGrid. ValueType string Default Value - |
AllowSorting | Description Specifies whether to allow user to sort the columns from within WebGrid. ValueType string Default Value - |
AllowGrouping | Description Specifies whether to allow user to group columns from within WebGrid. ValueType string Default Value - |
AutomaticSort | Description Specifies whether to allow WebGrid to automatically handle sorting operation. ValueType boolean Default Value - |
AutomaticFilter | Description Specifies whether to allow WebGrid to automatically handle filtering operation. ValueType boolean Default Value - |
CellClickAction | Description Specifies the action when a user clicks on a cell. ValueType string Default Value - |
ColumnHeaders | Description Specifies whether to display column headers. ValueType string Default Value - |
ColumnFooters | Description Specifies whether to display column footers. ValueType string Default Value - |
ColumnWidthDefault | Description Specifies the default column width in Unit. ValueType integer Default Value - |
HeaderClickAction | Description Specifies the action when a user clicks on a column header. ValueType string Default Value - |
GroupRowInfoFormatDefault | Description Gets or sets the default group row's format string. ValueType string Default Value - |
RowHeaders | Description Specifies whether to display row headers. ValueType string Default Value - |
FocusCellStyle | Description Gets or sets the style used when a row or cell is focused/selected. ValueType object (FocusStyle) Default Value - |
Caption | Description Gets or sets the text displayed in the table header. ValueType string Default Value - |
DataKeyField | Description Gets or sets the key field in the data source specified by the DataSource property and DataMember specified in the WebGridTable object. ValueType string Default Value - |
DataMember | Description Gets or sets the name of data source for which the table displays its data. ValueType string Default Value - |
NewRowInfoText | Description Gets or sets the text that will be displayed in the NewRow when it is not in focus. ValueType string Default Value - |
GroupMode | Description Gets or sets a value that indicates whether groups should be collapsed or expanded when groups are calculated. ValueType string Default Value - |
RowStyle | Description Gets or sets the style applied to the row. ValueType string Default Value - |
SelectedRowStyle | Description Gets or sets the style applied to the selected row. ValueType string Default Value - |
HideColumnsWhenGrouped | Description Specifies whether the column headers of grouped columns is hidden. ValueType string Default Value - |
NewRowStyle | Description The style applied to new row. ValueType string Default Value - |
ChildTables | Description Gets the collection of child WebGridTable object. ValueType object (WebGridTable) Default Value - |
Layout | Description Gets the LayoutSet object to which the object belongs. ValueType object (LayoutSet) Default Value - |
Columns | Description Gets the collection of the WebGridColumn objects. ValueType object (WebGridColumn) Default Value - |
Rows | Description Gets the collection of WebGridRow objects. ValueType object Default Value - |
TableHeaderVisible | Description Determines whether to display table headers. ValueType boolean Default Value - |
GroupTotalVisible | Description Determines whether total row for each GroupRow should be shown. ValueType boolean Default Value - |
GroupedColumns | Description Gets the collection of WebGridGroup objects. ValueType object (WebGridGroup) Default Value - |
SortedColumns | Description Gets the collection of WebGridGroup objects. ValueType object (WebGridGroup) Default Value - |
FilteredColumns | Description Gets the collection of WebGridFilter objects. ValueType object (WebGridFilter) Default Value - |
RowLayout | Description Specifies the row's rendering layout mode. ValueType string Default Value - |
PreviewRowSettings | Description Specifies the PreviewRow settings. ValueType object (PreviewRowSettings) Default Value - |
PreviewRowVisible | Description Set the visibility of the PreviewRow. ValueType boolean Default Value - |
ColumnSets | Description Gets the collection of ColumnSet. ValueType object (ColumnSets) Default Value - |
ColumnSetSettings | Description Specifies the ColumnSet settings. ValueType object (ColumnSetSettings) Default Value - |
SelfReferencingSettings | Description Specifies the SelfReferencing settings. ValueType object (SelfReferencingSettings) Default Value - |
IsUseColumnSet | Description Determines whether this table is valid to use ColumnSet for rendering the row layout. ValueType boolean Default Value - |
HasMultiPrimaryKey | Description Determines whether this table has multiple primary keys. ValueType boolean Default Value - |
DataKeyFields | Description Gets the DataKeyField collection. ValueType string Default Value - |
DataKeyFieldsCount | Description Gets the number of the DataKeyFields. ValueType integer Default Value - |
Id | Description Gets the WebGridTable ID. ValueType string Default Value - |
SubTableIds | Description Gets the WebGridTable SubTable ID. ValueType object Default Value - |
Formulas | Description Gets the WebGridTable formula. ValueType object (WebGridFormula Collection) Default Value - |
GridId | Description Gets the WebGridTable grid ID. ValueType string Default Value - |
UniqueConstraints | Description Gets the WebGridTable UniqueConstraints. ValueType string Default Value - |
WebGridTable Methods
GetParentTables |
Description Returns the XML Object of the table which is parent of this table. Parameters - Remarks Return Value
function DoGetParentTables()
{ var grid = ISGetObject("WebGrid1"); var childTbl = grid.Tables["Orders"]; alert(childTbl.GetParentTables());
return true;
} |
GetChildTables |
Description Returns the IXMLNodeList for available child tables of this table. Parameters - Remarks Return Value
Samples
function DoGetChildTables()
{ var grid = ISGetObject("WebGrid1"); var rootTbl = grid.RootTable; alert(rootTbl.GetChildTables());
return true;
} |
GetNewRow |
Description Retrieves the HTML row element of the new row for the specified table. Parameters
Remarks Return Value
Samples
function SelectNewRow()
{ var grid = ISGetObject("WebGrid1");
// return the html element of the NewRow
var newRowElement = grid.RootTable.GetNewRow();
// convert to WebGridRow object
var newRow = grid.RootTable.ToRowObject(newRowElement); // select new row newRow.Select(); // populate cells var cells = newRow.GetCells();
// activate edit cell on City cell, instead of first cell
cells.GetNamedItem("City").ActivateEdit();
// set the CustomerID cell's text to NEWCUST,
// 2nd parameter is true indicating that the value is same as the text. cells.GetNamedItem("CustomerID").SetText("NEWCUST", true); cells.GetNamedItem("Address").SetText("New Address", true); // indicates that this row's data has been changed. newRow.SetDataChanged();
// sets the row's status as edited,
// as if user has typed inside the cell. grid.MarkEdit(); } |
GetSubTablePosById |
Description Gets the current SubTable position. Parameters
Remarks Return Value
Samples
function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{ var grid = ISGetObject(gridId);
if(tblName == "Orders")
{ var subTblColl = grid.Tables[tblName].SubTableIds;
var firstSubTbl = subTblColl[0];
var parentRowKeyValue = ISGetObject("WebGrid1").GetSelectedObject().GetRowObject().GetParentRow().KeyValue;
alert( grid.Tables[tblName].GetSubTablePosById(firstSubTbl.SubId));
alert( grid.Tables[tblName].GetSubTableById(firstSubTbl.SubId).Id);
alert(ISGetObject("WebGrid1").Tables["Orders"].GetSubIdByParentKey(parentRowKeyValue));
}
return true;
} |
GetContainer |
Description Gets the container object for the child table referred by specified row object. Parameters
Remarks Return Value
Samples
function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{ var grid = ISGetObject("WebGrid1");
alert(grid.Tables[tblName].GetContainer(rowElm));
return true;
} |
SelectRow |
Description Selects and highlights the specified row index. Parameters
Remarks - Return Value
Samples
function DoSelectRow()
{ var grid = ISGetObject("WebGrid1"); grid.RootTable.SelectRow(1); return true; } |
GetSelRowStyle |
Description Returns the style used when the row is selected. Parameters - Remarks Return Value
Samples
function DoGetSelRowStyle()
{ var grid = ISGetObject("WebGrid1"); alert(grid.RootTable.GetSelRowStyle()); return true; } |
GetFocusCellStyle |
Description Returns the style of the focus cell. Parameters - Remarks Return Value
function DoGetFocusCellStyle()
{ var grid = ISGetObject("WebGrid1"); alert(grid.RootTable.GetFocusCellStyle()); return true; } |
GetCheckedRowStyle |
Description Returns the checked row style for this table. Parameters - Remarks Return Value
Samples
function DoGetCheckedRowStyle()
{ var grid = ISGetObject("WebGrid1"); alert(grid.RootTable.GetCheckedRowStyle()); return true; } |
GetColumn |
Description Returns the IXMLNodeList of available columns of this table. Parameters
Remarks Return Value
Samples
function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{ var grid = ISGetObject("WebGrid1");
alert(grid.Tables[tblName].GetColumn("CustomerID");
return true;
} |
IsFilterRowVisible |
Description Determines whether the filter row is visible. Parameters - Remarks Return Value
Samples
function GetFilterRowVisibility()
{ var grid = ISGetObject("WebGrid1");
alert(grid.RootTable.IsFilterRowVisible());
return true;
} |
GetFilterEditType |
Description Gets the filter edit type of specific column. Parameters
Remarks Return Value
Samples
function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{ var grid = ISGetObject("WebGrid1");
alert(grid.Tables[tblName].GetFilterEditType("CustomerID"));
return true;
} |
GetRowCheckerColumn |
Description Gets the column's name of the column which has been configured as RowChecker column. Parameters - Remarks Return Value
Samples
function DoGetRowCheckerColumn()
{ var grid = ISGetObject("WebGrid1"); alert(grid.RootTable.GetRowCheckerColumn()); return true; } |
GetCheckedRows |
Description Returns the checked rows for this table. Parameters - Remarks Return Value
Samples
function DoGetCheckedRows()
{ var grid = ISGetObject("WebGrid1"); alert(grid.RootTable.GetCheckedRows);
var numOfCheckedRows = grid.RootTable.GetCheckedRows.length;
for(int i=0; i<numOfCheckedRows; i++)
{ var htmlRow = grid.RootTable.GetCheckedRows()[i]; var wgRowObject = grid.RootTable.ToRowObject(htmlRow);
alert(wgRowObject.KeyValue);
} return true; } |
GetAutoWidthColumn |
Description Gets the column name which has been set to AutoWidth. Parameters - Remarks Return Value
Samples
function DoGetAutoWidthColumn()
{ var grid = ISGetObject("WebGrid1"); alert(grid.RootTable.GetAutoWidthColumn().Name); return true; } |
GetSubTableById |
Description Gets the WebGridSubTable object. Parameters
Remarks Return Value
Samples
function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{ var grid = ISGetObject(gridId);
if(tblName == "Orders")
{ var subTblColl = grid.Tables[tblName].SubTableIds; var firstSubTbl = subTblColl[0];
var parentRowKeyValue = ISGetObject("WebGrid1").GetSelectedObject().GetRowObject().GetParentRow().KeyValue;
alert( grid.Tables[tblName].GetSubTablePosById(firstSubTbl.SubId));
alert( grid.Tables[tblName].GetSubTableById(firstSubTbl.SubId).Id);
alert(ISGetObject("WebGrid1").Tables["Orders"].GetSubIdByParentKey(parentRowKeyValue));
}
return true;
} |
GetRowLayoutByColName |
Description Gets the WebGridRowLayout object by given column's name. Parameters
Remarks
Samples
function GetRowLayoutByColName()
{ var grid = ISGetObject("WebGrid1");
var rl = grid.RootTable.GetRowLayoutByColName("FirstName");
alert(rl.ColumnMember);
return true; } |
GetRowLayoutByIndex |
Description Gets the WebGridRowLayout object from certain row and column. Parameters
Remarks
function GetColumnSetColumnMember()
{ var grid = ISGetObject("WebGrid1");
var rl = grid.RootTable.GetRowLayoutByIndex(0,1,2);
alert(rl.ColumnMember);
return true; } |
GetColumnSetByPos |
Description Obtains the ColumnSet object of the WebGridTable. Parameters
Remarks
Samples
function GetColumnSetName()
{ var grid = ISGetObject("WebGrid1");
var cs = grid.RootTable.GetColumnSetByPos(0);
alert(cs.Caption);
return true; } |
GetParentRow |
Description Gets the parent row HTML row element. Parameters
Remarks
Samples
function DoRowSelect(controlId, tblName, rowIndex, rowEl)
{ // use these codes // only on child table var grid = ISGetObject(controlId); var parentRowElm = grid.Tables[tblName].GetParentRow(rowEl);
if(parentRowElm)
{ var keyValue = grid.RootTable.ToRowObject(parentRowElm).KeyValue; alert(keyValue); } } |
CreateFormula |
Description Creates a formula in order to calculate the value of a cell. Parameters
Remarks
Samples
function InitializeGrid(gridId) {
var tb = wgGetGridById(gridId).Tables["Orderx0020xDetails"]; // create formula for SubTotal cell of Order Details table. tb.CreateFormula("SubTotal", "[Quantity] * ([UnitPrice] - ([UnitPrice] * [Discount]) )"); } |
Refresh |
Description Performs refresh on the particular table only, without refreshing the whole tables (root table and child tables). Parameters - Remarks
Samples
function refreshChild() {
var grid = wgGetGridById("WebGrid1"); grid.Tables["Orders"].Refresh(); } |
GetDataKeyFieldsCount |
Description Gets the number of DataKeyField. Parameters - Remarks
Samples
function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{ var grid = ISGetObject("WebGrid1");
alert(grid.Tables[tblName].GetDataKeyFieldsCount());
return true;
} |
GetTableElementRowsCount |
Description Gets the TableElement rows number. Parameters
Remarks
Samples
function DoRowSelect(gridId, tblName, rowIdx, rowElm) { var grid = ISGetObject("WebGrid1");
alert(grid.Tables[tblName].GetTableElementRowsCount(rowElm));
return true;
} |
GetRowsCount |
Description Gets the number of row. Parameters - Remarks
Samples
function DoGetRowsCount()
{ var grid = ISGetObject("WebGrid1"); var row = grid.RootTable.GetRowsCount(); return true; } |
ToRowObject |
Description Converts the supplied HTML row element to WebGridRow object. Parameters
Remarks
Samples
function SelectNewRow()
{ var grid = ISGetObject("WebGrid1");
// return the html element of the newrow
var newRowElement = grid.RootTable.GetNewRow();
// convert to WebGridRow object
var newRow = grid.RootTable.ToRowObject(newRowElement); // select new row newRow.Select(); // populate cells var cells = newRow.GetCells();
// activate edit cell on City cell, instead of first cell
cells.GetNamedItem("City").ActivateEdit();
// set the CustomerID cell's text to NEWCUST,
// 2nd parameter is true indicating that the value is same as the text. cells.GetNamedItem("CustomerID").SetText("NEWCUST", true); cells.GetNamedItem("Address").SetText("New Address", true); // indicates that this row's data has been changed. newRow.SetDataChanged();
// sets the row's status as edited,
// as if user has typed inside the cell. grid.MarkEdit(); } |
GetRow |
Description Obtains a WebGridRow object. Parameters
Remarks
Samples
function DoGetRow()
{ var grid = ISGetObject("WebGrid1"); var row = grid.RootTable.GetRow(0); return true; } |
GetRowByKeyValue |
Description Gets a WebGridRow object by a KeyValue. Parameters
Remarks
Samples
function DeleteRow()
{ var grid = ISGetObject("WebGrid1");
// get WebGridRow object by key value.
var row = grid.RootTable.GetRowByKeyValue("VINET");
// select this row for focus
row.Select(); alert("Click OK to delete this row.");
// delete this row
row.Delete(); alert("Customer 'VINET' has been deleted!"); } |
GetRowByGroup |
Description Gets group row at intended position which is located in certain group index. Parameters
Remarks
Samples
function SelectFirstRow()
{ var grid = ISGetObject("WebGrid1");
// access WebGridRow object at position 0
// (GetRow excluding GroupRows) var row = grid.RootTable.GetRow(0);
if (grid.RootTable.GroupedColumns.length > 0)
{ // make sure first group is expanded // get group row at position 0 which group index is 0. var firstGroupRow= grid.RootTable.GetRowByGroup(0, 0); if (!firstGroupRow.GroupExpanded) firstGroupRow.ExpandGroupRow(); } // select the row row.Select(); } |
GetSubIdByParentKey |
Description Gets WebGridSubTable ID. Parameters
Remarks
Return Value
Samples
function DoRowSelect(gridId, tblName, rowIdx, rowElm)
{ var grid = ISGetObject(gridId);
if(tblName == "Orders")
{ var subTblColl = grid.Tables[tblName].SubTableIds;
var firstSubTbl = subTblColl[0];
var parentRowKeyValue = ISGetObject("WebGrid1").GetSelectedObject().GetRowObject().GetParentRow().KeyValue;
alert( grid.Tables[tblName].GetSubTablePosById(firstSubTbl.SubId));
alert( grid.Tables[tblName].GetSubTableById(firstSubTbl.SubId).Id);
alert(ISGetObject("WebGrid1"). Tables["Orders"].GetSubIdByParentKey(parentRowKeyValue));
var parentRowKeyValue = grid.Tables[tblName].ToRowObject(rowElm).GetParentRow().RelNames;
alert(grid. Tables[tblName].GetSubIdByParentKey(parentRowKeyValue)); }
return true;
} |
NewRow |
Description Gets the NewRow element. Parameters
Remarks
Samples
|
GetSelfRefParent |
Description Gets SelReference parent HTML row element. Parameters
Remarks
|
GetGroupRows |
Description Obtains the collection of the GroupRows. Parameters - Remarks
Samples
function GetRootGroupRows()
{ var grid = ISGetObject("WebGrid1");
// get group rows available in root table.
var groupRows = grid.RootTable.GetGroupRows(); var s = "Root Table has " + groupRows.length + " group rows. The group rows are: "; for(var i=0; i<groupRows.length; i++) { var groupRow = groupRows[i]; // get the group row's text s += groupRow.GroupRowText + " "; } alert(s); } |
UpdateUI |
Description Updates user interface to reflect changes. Parameters - Remarks
Samples
function AddFilter()
{ var grid = ISGetObject("WebGrid1"); // construct WebGridFilter object var newFilter = new WebGridFilter();
// assign properties the same way as in server side
newFilter.ColumnMember = "ContactTitle";
// use the same enumeration as in server side
newFilter.FilterType = "EqualTo"; newFilter.FilterText = "Owner"; // add new filter column the same way as in server side grid.RootTable.FilteredColumns.Add(newFilter); // update User Interface to reflect changes grid.RootTable.UpdateUI(); // perform refresh to get the filter applied grid.Refresh();
alert("ContactTitle Column is now filtered!");
} |
GetChanges |
Description Returns a list of pending changes that existed in this table. Parameters rowState Specifies the state of the changes to get. Remarks
Samples |
GetChangesCount |
Description Returns the count of the pending changes in this table) Parameters - Remarks
Samples |
UndoChanges |
Description Undo all pending changes in this table Parameters - Remarks
Samples |
InvalidateChanges |
Description Invalidate all pending changes in this table. Parameters - Remarks
Samples |
GetUngroupedRows |
Description Gets ungrouped rows collection of this table. Parameters - Remarks
Samples |
GetRowByKeyValues |
Description Gets the WebGridRow based on the specified key values. Parameters keyValues Remarks
Samples |
DispatchDataTable |
Description Gets the CDOF data table object. Parameters - Remarks
Samples |
GetView |
Description Gets the CDOF data view object. Parameters - Remarks
Samples |
DataBind |
Description Perform data binding for this table. Parameters - Remarks
Samples |
FillDataSourceArguments |
Description Populate view state into data source arguments used for data retrieval operation. Parameters arguments sortState filterState pagingState Remarks
Samples |
GetSortExpression |
Description Gets the sort expression required to construct the view for this table. Parameters - Remarks
Samples |
GetFilterExpression |
Description Gets the filter expression required to construct the view for this table. Parameters - Remarks
Samples |
Render |
Description Render the view for this table. Parameters subTable Remarks
Samples |
UpdateDataStatus |
Description Updates the status of current datasource to UI. Parameters - Remarks
Samples |