Skip to content

{ Tag Archives } NetAdvantage

在UltraWebGrid中增加CheckBox列

首先,先在UltraWebGrid中增加一个模板列(Templated Column),该列的Type值要设置成”CheckBox”。那么,现在在UltraWebGrid中就已有了一个CheckBox列。 现在,要在该列的Header上加上一个CheckBox,当点击这个CheckBox时,可以在客户端上进行“全选”/“全不选”操作。 编辑这列的HeaderTemplate,增加一个id、name都为cbSelectAll的Checkbox。如下所示: <igtbl:TemplatedColumn Type=“CheckBox”> <HeaderTemplate> <input id=“cbSelectAll” name=“cbSelectAll” type=“checkbox” onclick=“SelectAll(0)”/> </HeaderTemplate> </igtbl:TemplatedColumn> 增加JavaScript函数SelectAll()和igrdInitializeLayout(): var oGrid; var cbSelectAll; //Selects all checkboxes in the grid function SelectAll(colIndex) { var checked = cbSelectAll.checked; for (i = 0; i < oGrid.Rows.length; i++) { oGrid.Rows.getRow(i).getCell(colIndex).setValue(checked); } } //Intialization function which sets the grid reference function igrdInitializeLayout(object) { oGrid [...]

Also tagged ,

在客户端阻止删除UltraWebGrid中的行

首先,要设置UltraWebGrid的DisplayLayout.ClientSideEvents.BeforeRowDeletedHandler = “BeforeDelete”。然后增加js函数BeforeDelete. function BeforeDelete(gridname, rowid) { //获取要删除的row var row=igtbl_getRowById(rowid); //获取当前行的第2个单元格 var value=row.getCell(1).getValue(); //检查该单元格的值,如果为真,则不删除该row。否则就删除该row if(value==true) { return true; } }

Also tagged ,

在客户端删除UltraWebGrid的所有行

有时需要在客户端上删除某个UltraWebGrid中所有的行,而如果按照帮助文件中例子的方法来操作的话,是无法删除行的。经询问NetAdvantage工程师,给出一个能用的例子。 ?View Code JAVASCRIPT//帮助中的例子,不可用 function DeleteRow() { // Row deletion needs to be allowed igtbl_getGridById("UltraWebGrid1").AllowDelete=1; // Get the first row in the grid var row=igtbl_getRowById("UltraWebGrid1r_0"); // Delete the first row in the grid igtbl_deleteRow("UltraWebGrid1","UltraWebGrid1r_0"); // Create a counter for the row id var cnt=0; // Create a loop, if the row has a next sibling [...]

Also tagged ,

WebCombo in UltraWebGrid

在将NetAdvantage升级到2008 vol2后,发现在2008 vol1版本中能正常使用的UltraWebGrid绑定WebCombo功能,如果WebCombo的Editable属性设为true话,那么在2008 vol2版本中将会抛出异常:WebCombo has the Editable property set to True; therefore it must have equal DataTextField and DataValueField to be used as an editor in an UltraWebGrid. 经与NetAdvantage开发人员联系,已确定在2008 vol2版本中,如果WebCombo的DataValueField不与DataTextField相同的话,那么在UltraWebGrid中的WebCombo不支持Editable=true。解决办法是用2008 vol1这个版本。 NetAdvantage开发人员回信如下: The webcombo does not support editable=true, when the DataValueField is different from the DataTextField.  This is done because the user only has the [...]

Also tagged , ,

UltraWebGrid的一个Bug

在使用NetAdvantage for .NET 2008 Vol.2 CLR3.5中的UltraWebGrid时,发现一个Bug. 如果按照Samples中Grid下的Row Updating例子写代码,那么当点击“Sumbit Change”时,会显示异常信息:System.NullReferenceException: 未将对象引用设置到对象的实例。 跟踪进去,在UpdateRowBatch事件中,并没报错,而却还没进”Sumbit Change”按钮的OnClick事件时,就已抛出异常了。 看了下代码,将databind()屏蔽,就不再抛同异常。

Also tagged ,

NetAdvantage for .NET 2008 Vol.2 CLR3.5 下载

NetAdvantage for .NET 2008 Vol. 2 Bundle [CLR 3.5] 下载: HTTP下载 eMule下载 SN:9307-1200212-2268136

Also tagged