2009-07-16 92 views
0

我正在使用Infragistics的UltraGrid,並在選擇單元格值時遇到問題。每當我選擇一個單元格值時,它顯示爲默認值0.000。我想將它顯示爲0或1.我已經使用UltraGrid設計器進行了更改,但出於某種原因它總是顯示0.0000。奇怪的是,當集合綁定到網格時,它只包含0或1.雖然列的數據類型是十進制的。Infragistics UltraGrid選定的單元格值

回答

0

似乎問題與綁定到列的Decimal類型字段有關。我將該字段更改爲Double,現在它工作正常!

1

我找到了一個解決方案來檢索infragistic的UltraGrid當前複選框值:

private void grid_CellChange(object sender, CellEventArgs e) 
     { 

// retrieve the current checkbox value 

this.grid.Rows[e.Cell.Row.Index].Cells["Selection"].Value = !((bool)this.grid.Rows[e.Cell.Row.Index].Cells["Selection"].Value); 

bool selVal = (bool)this.grid.Rows[e.Cell.Row.Index].Cells["Selection"].Value; 

... 
} 
相關問題