Beispiel #1
0
 private void dvgBsDetails_FocusedColumnChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedColumnChangedEventArgs e)
 {
     if (e.FocusedColumn.FieldName == "BillSundry")
     {
         dvgBsDetails.ShowEditor();
         ((LookUpEdit)dvgBsDetails.ActiveEditor).ShowPopup();
     }
 }
Beispiel #2
0
 private void gridView1_FocusedColumnChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedColumnChangedEventArgs e)
 {
     if (!_isCanEdit)
     {
         return;
     }
     if (e.FocusedColumn == null)
     {
         return;
     }
     gridView1.OptionsBehavior.Editable = SetCanEdit(gridView1.FocusedRowHandle, e.FocusedColumn.ColumnHandle);
 }
Beispiel #3
0
 private void gridView1_FocusedColumnChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedColumnChangedEventArgs e)
 {
     if (!_isCanEdit)
     {
         return;
     }
     if (e.FocusedColumn == null)
     {
         return;
     }
     gridView1.OptionsBehavior.Editable = SetCanEdit(gridView1.FocusedRowHandle, e.FocusedColumn.ColumnHandle);
     //if (gridView1.FocusedColumn != null)
     //{
     //    int c = e.FocusedColumn.ColumnHandle;
     //    if (gridView1.FocusedRowHandle == 0)
     //    {
     //        if (c > 0 && c < gridView1.Columns.Count - 3)
     //        {
     //            if (gridView1.GetRowCellValue(0, gridView1.Columns[c - 1]).ToString() != "")
     //            {
     //                gridView1.OptionsBehavior.Editable = true;
     //                AddReSizeItems();
     //            }
     //            else
     //                gridView1.OptionsBehavior.Editable = false;
     //        }
     //        else
     //        {
     //            gridView1.OptionsBehavior.Editable = false;
     //        }
     //    }
     //    if (gridView1.FocusedRowHandle > 0 && gridView1.FocusedRowHandle < gridView1.RowCount - 1)
     //    {
     //        if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[0]).ToString() != "" &&
     //            gridView1.GetRowCellValue(0, e.FocusedColumn).ToString() != "")
     //            gridView1.OptionsBehavior.Editable = true;
     //        else
     //            gridView1.OptionsBehavior.Editable = false;
     //        if (gridView1.FocusedRowHandle > 0 && c == 0 && gridView1.GetRowCellValue(gridView1.FocusedRowHandle - 1, e.FocusedColumn).ToString() != "")
     //            gridView1.OptionsBehavior.Editable = true;
     //    }
     //}
 }
Beispiel #4
0
        private void dvgItemDetails_FocusedColumnChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedColumnChangedEventArgs e)
        {
            if (e.FocusedColumn.FieldName == "Item")
            {
                dvgItemDetails.ShowEditor();
                ((LookUpEdit)dvgItemDetails.ActiveEditor).ShowPopup();
            }
            if (e.FocusedColumn.FieldName == "Unit" || e.FocusedColumn.FieldName == "Per" || e.FocusedColumn.FieldName == "Particulars")
            {
                dvgItemDetails.ShowEditor();
                ((LookUpEdit)dvgItemDetails.ActiveEditor).ShowPopup();
            }

            //tbxSaleType.SelectedItem.ToString() == "VAT Incl";


            GridView view = sender as GridView;

            if (view.GetFocusedRowCellValue("Qty") == null)
            {
                return;
            }

            decimal Qty      = Convert.ToDecimal(view.GetFocusedRowCellValue(view.Columns["Qty"]).ToString() == string.Empty ? "0.00" : view.GetFocusedRowCellValue(view.Columns["Qty"]).ToString());
            decimal Price    = Convert.ToDecimal(view.GetFocusedRowCellValue(view.Columns["Price"]).ToString() == string.Empty ? "0.00" : view.GetFocusedRowCellValue(view.Columns["Price"]).ToString());
            decimal BasicAmt = Convert.ToDecimal(view.GetFocusedRowCellValue(view.Columns["BasicAmt"]).ToString() == string.Empty ? "0.00" : view.GetFocusedRowCellValue(view.Columns["BasicAmt"]).ToString());
            decimal TotalAmt = Convert.ToDecimal(view.GetFocusedRowCellValue(view.Columns["Amount"]).ToString() == string.Empty ? "0.00" : view.GetFocusedRowCellValue(view.Columns["Amount"]).ToString());
            decimal TaxSlab  = 5;

            TaxCalculationModel objTax = objSTCal.GetCalculatedTax(TaxType.VATIncl, Qty, Price, BasicAmt, TaxSlab, TotalAmt);

            //Bind to Grid view based on the model values
            view.SetFocusedRowCellValue(view.Columns["Amount"], Math.Round(objTax.TotalAmount, 2));
            view.SetFocusedRowCellValue(view.Columns["BasicAmt"], Math.Round(objTax.BasicAmount, 2));
            view.SetFocusedRowCellValue(view.Columns["TaxAmount"], Math.Round(objTax.TaxAmount, 2));
            view.SetFocusedRowCellValue(view.Columns["Price"], Math.Round(objTax.Price, 2));
        }
Beispiel #5
0
        /* private void SetFocusedColumnAppearance(DevExpress.XtraGrid.Columns.GridColumn col1, DevExpress.XtraGrid.Columns.GridColumn col2)
         * {
         *
         *   if (col1 != null) col1.AppearanceCell.Reset();
         *   if (col2 != null)
         *       //if (3.Equals(radioGroup1.EditValue))
         *       //{
         *       col2.AppearanceCell.BackColor = SystemColors.Highlight;
         *   col2.AppearanceCell.ForeColor = SystemColors.HighlightText;
         *   //}
         *   //else
         *   //    col2.AppearanceCell.Reset();
         * }*/

        void gridView_FocusedColumnChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedColumnChangedEventArgs e)
        {
            SetFocusedColumnAppearance(e.PrevFocusedColumn, e.FocusedColumn);
        }