object eachprice = gridView1.GetRowCellValue(gridView1.FocusedRowHandle,gridView1.Columns["Price"])
object eachprice = gridView1.GetRowCellValue(gridView1.FocusedRowHandle-1, gridView1.Columns["Price"]);
private void discountcol() { if ((getdisc == tempstr) && (rownumber >= 1)) { int focusedcount = gridView1.FocusedRowHandle; t1.Text = ""; t1.Text = getdisc; object eachprice = gridView1.GetRowCellValue(focusedcount-1, gridView1.Columns["Price"]); t2.Text = eachprice.ToString(); if (!(t2.Text == string.Empty)) { decimal pricedecimal = Convert.ToDecimal(t2.Text); object eachdiscount = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["Price"]); decimal eachdisdecimal = Convert.ToDecimal(eachdiscount); decimal tempdiscountprice = -(pricedecimal * (eachdisdecimal / 100)); // -ve calculation t3.Text = tempdiscountprice.ToString("N2"); gridView1.SetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["Price"], t3.Text); if (getdisc == tempstr) { PricQuan.UnboundType = DevExpress.Data.UnboundColumnType.Decimal; PricQuan.UnboundExpression = " 1 * [Price]"; TaxinAmount.UnboundType = DevExpress.Data.UnboundColumnType.Decimal; TaxinAmount.UnboundExpression = " ([Price] * ([TaxInPercentage] / 100.0)) * 1 "; } else { //PricQuan.UnboundType = DevExpress.Data.UnboundColumnType.Decimal; //PricQuan.UnboundExpression = " Round([Quantity] * [Price], 2)"; //TaxinAmount.UnboundType = DevExpress.Data.UnboundColumnType.Decimal; //TaxinAmount.UnboundExpression = " ([Price] * ([TaxInPercentage] / 100.0)) * [Quantity] "; } } } else { } }
object Value = MyGridView.GetRowCellValue("ColumnName", MyGridView.FocusedRowHandle - 1);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)