New Product Launch - BoldDesk !
Introducing help desk ticketing software.
New Product LaunchBoldDesk: Help desk ticketing software starts at $10 for 3 agents.
Try it for free.private void gridDataBoundGrid1_CurrentCellAcceptedChanges(object sender, CancelEventArgs e) { try { GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; int row = cc.RowIndex; int priceColIndex = gridDataBoundGrid1.NameToColIndex("Price"); int qtyColIndex = gridDataBoundGrid1.NameToColIndex("Qty"); int totalColIndex = gridDataBoundGrid1.NameToColIndex("Total"); if(cc.ColIndex == priceColIndex || cc.ColIndex == qtyColIndex) { decimal price = ParseDecimal(gridDataBoundGrid1[row, priceColIndex].CellValue, 0.00M); decimal qty = ParseDecimal(gridDataBoundGrid1[row, qtyColIndex].CellValue, 0.00M); Console.WriteLine("Row="+row+", price="+price+", qty="+qty); Console.WriteLine("RowCount=" + gridDataBoundGrid1.Model.RowCount); gridDataBoundGrid1[row, totalColIndex].CellValue = price * qty; this.gridDataBoundGrid1.RefreshRange(GridRangeInfo.Cell(row, totalColIndex)); } } catch(Exception ex) { Console.WriteLine("Error: " + ex); } }To handle the DBNull problem I added an etra condition to your parse code.
if(o != null && o != DBNull.Value)