Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to clear a cell value of bounded column in Gridview Winforms Devexpress?
    primarykey
    data
    text
    <p>How to clear a cell value of Bounded column in Gridview ?? I perform some calculation and set a int value to a cell(bounded column). Again I recalculate that and try to set in same cell in bounded column time the value not changing so I try to clear the cell value before set a value to it. </p> <pre><code> private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { // % to amt object obj = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["DiscountPercentage"]) == DBNull.Value ? 0 : (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["DiscountPercentage"])); decimal a = Convert.ToDecimal(obj); if (a &gt; 0) { gridColumn1.UnboundType = DevExpress.Data.UnboundColumnType.Decimal; gridColumn1.UnboundExpression = "[UnitPrice] * ([DiscountPercentage] / 100.0)"; } // amt to % object dm = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["DiscountAmount"]) == DBNull.Value ? 0 : (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["DiscountAmount"])); decimal a1 = Convert.ToDecimal(dm); if (a1 &gt; 0) { gridColumn2.UnboundType = DevExpress.Data.UnboundColumnType.Decimal; gridColumn2.UnboundExpression = "Round(([DiscountAmount] / [UnitPrice]) * 100.0, 2)"; } } private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { // % to amt object obj = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["DiscountPercentage"]) == DBNull.Value ? 0 : (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["DiscountPercentage"])); decimal a = Convert.ToDecimal(obj); if (a &gt; 0) { object obj2 = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["gridColumn1"]); int aa = Convert.ToInt32(obj2); gridView1.SetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["DiscountAmount"], aa); } // amt to % object dm = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["DiscountAmount"]) == DBNull.Value ? 0 : (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["DiscountAmount"])); decimal a1 = Convert.ToDecimal(dm); if (a1 &gt; 0) { object obj3 = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["gridColumn2"]); int aa2 = Convert.ToInt32(obj3); gridView1.SetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["DiscountPercentage"], aa2); } } </code></pre> <p>Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload