ultrawebgrid

//获得数据网格选中行的行号
        function GetSelectRowIndex()
        
{
            
var oGrid = ogrdOpition;
            
if (oGrid == null)
            
{
                alert(
"对不起,请先选择一条资产信息!");
                
return -1;
            }

            
if (oGrid.getActiveRow() == null || oGrid.getActiveRow() == 'undefined')
            
{
                alert(
"对不起,请先选择一条资产信息!");
                
return -1;
            }

            
//return 2;
            return oGrid.getActiveRow().getCell(0).getValue();
        }
function gidManager_AfterCellUpdateHandler(gridName, cellId){
            
var cellList = cellId.split("_");
            
if(cellList[1== null||cellList[2== null)
                
return;
                
            
var cellRowIndex = cellList[1];
            
var cellColIndex = cellList[2];
            
var cellValue = ogidManager.Rows.getRow(cellRowIndex).getCell(cellColIndex).getValue();
            
var NetValue = ogidManager.Rows.getRow(cellRowIndex).getCell(7).getValue();//净值
            var RemainValue = ogidManager.Rows.getRow(cellRowIndex).getCell(8).getValue();//残值
            if(cellValue == null)
            
{
                ogidManager.Rows.getRow(cellRowIndex).getCell(cellColIndex).setValue(
0);
            }

            
if(NetValue - cellValue< RemainValue)
            
{
                
if(confirm("<%=sDisAmountName%>过大,净值减去<%=sDisAmountName%>应该大于残值,是否让系统自动修改?"))
                
{
                    ogidManager.Rows.getRow(cellRowIndex).getCell(cellColIndex).setValue(NetValue 
- RemainValue);
                }

            }
    
        }
    

var oRows = oGrid.Rows;
(oRow.getCell(0).getValue() == "true"如果为checkBox
求和
function grdOffice_AfterCellUpdateHandler(gridName, cellId){
            
//Add code to handle your event here.
            SumAmount();
        }

        
        
function SumAmount()
        
{
            
var total = 0;
            
for (var i=0;i<ogrdOffice.Rows.length;i++)
            
{
                total 
= total + parseFloat(ogrdOffice.Rows.getRow(i).getCell(2).getValue());
            }

            document.getElementById(
"grdOfficef_0_2").innerText = "¥ " + total.toFixed(2);
        }

private 
void grdOffice_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
        
{
            Infragistics.WebUI.UltraWebGrid.UltraGridColumn c ;
            Infragistics.WebUI.UltraWebGrid.ColumnFooter cf;

            c  
= e.Layout.Bands[0].Columns.FromKey("EXPENSENAME");
            cf 
= c.Footer ;
            cf.Key 
= "EXPENSENAME";
            cf.Caption 
= "合计";

            c  
= e.Layout.Bands[0].Columns.FromKey("AMOUNT");
            cf 
= c.Footer ;
            cf.Key 
= "AMOUNT";
            cf.Caption 
= "";
            cf.Total 
= Infragistics.WebUI.UltraWebGrid.SummaryInfo.Sum;
        }
            

ogridExpenseAccount.Rows.getRow(rowIndex).getCell(0).setValue(checkvalue == "true"?"false":"true");
posted on 2006-08-16 16:51  老狐狸  阅读(929)  评论(0)    收藏  举报