protected void grdGeneralJournal_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e)
        {
            if (e.Column.FieldName.Equals("Description"))
            {
                e.Editor.Focus();
            }
            else if (e.Column.FieldName.Equals("AccountId!Key"))
            {
                ASPxComboBox accountComboBox = (ASPxComboBox)e.Editor;
                if (accountComboBox != null)
                {
                    var accountList = AccountingBO.getNotParentAccountList(session);
                    accountComboBox.DataSource = accountList;
                    accountComboBox.DataBindItems();
                }
            }
            //if (e.Column.FieldName.Equals("AccountId!Key"))
            //{
            //    try
            //    {
            //        ASPxComboBox accountCombobox = e.Editor as ASPxComboBox;
            //        if (accountCombobox != null)
            //        {
            //            accountCombobox.ItemsRequestedByFilterCondition += new ListEditItemsRequestedByFilterConditionEventHandler(accountCombobox_ItemsRequestedByFilterCondition);
            //            accountCombobox.ItemRequestedByValue += new ListEditItemRequestedByValueEventHandler(accountCombobox_ItemRequestedByValue);
            //        }
            //    }
            //    catch (Exception ex)
            //    {

            //    }
            //}
        }
Example #2
0
        void AccountItemsRequestedByFilterCondition(object source, ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            ASPxComboBox comboItemUnit = source as ASPxComboBox;

            CriteriaOperator filter = new BinaryOperator("Code", "0", BinaryOperatorType.Equal);
            XPCollection <NAS.DAL.Accounting.AccountChart.Account> collection = new XPCollection <NAS.DAL.Accounting.AccountChart.Account>(session, filter);

            foreach (NAS.DAL.Accounting.AccountChart.Account account in AccountingBO.getNotParentAccountList(session))
            {
                collection.Add(account);
            }

            //collection.SkipReturnedObjects = e.BeginIndex;
            //collection.TopReturnedObjects = e.EndIndex - e.BeginIndex + 1;

            //CriteriaOperator criteria =
            //    CriteriaOperator.Or(
            //        new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like),
            //        new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like)
            //);

            //collection.Criteria = criteria;
            //collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

            comboItemUnit.DataSource = collection;
            comboItemUnit.DataBindItems();
        }
Example #3
0
        protected void grdBookingDetail_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e)
        {
            if (e.Column.FieldName == "RowStatus")
            {
                e.Editor.Value = 1;
                GridViewDataColumn col1  = ((ASPxGridView)sender).Columns["Credit"] as GridViewDataColumn;
                ASPxSpinEdit       spin1 = ((ASPxGridView)sender).FindEditRowCellTemplateControl(col1, "colBookingDetailCredit") as ASPxSpinEdit;
                spin1.Value = 0;

                GridViewDataColumn col2  = ((ASPxGridView)sender).Columns["Debit"] as GridViewDataColumn;
                ASPxSpinEdit       spin2 = ((ASPxGridView)sender).FindEditRowCellTemplateControl(col2, "colBookingDetailDebit") as ASPxSpinEdit;
                spin1.Value = 0;
            }

            if (e.Column.FieldName == "AccountId!Key")
            {
                ASPxComboBox combo = (ASPxComboBox)e.Editor;

                //combo.ItemsRequestedByFilterCondition += new ListEditItemsRequestedByFilterConditionEventHandler(AccountItemsRequestedByFilterCondition);
                //combo.ItemRequestedByValue += new ListEditItemRequestedByValueEventHandler(AccountItemRequestedByValue);

                ASPxComboBox accountCombobox = e.Editor as ASPxComboBox;
                accountCombobox.TextField  = "Code";
                accountCombobox.DataSource = AccountingBO.getNotParentAccountList(session);
                accountCombobox.DataBind();

                e.Editor.Focus();
            }
        }
Example #4
0
 protected void grdDetailEntry_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e)
 {
     if (e.Column.FieldName.Equals("AccountId!Key"))
     {
         ASPxComboBox accountComboBox = (ASPxComboBox)e.Editor;
         if (accountComboBox != null)
         {
             accountComboBox.DataSource = AccountingBO.getNotParentAccountList(session);
             accountComboBox.DataBindItems();
             e.Editor.Focus();
         }
     }
 }
Example #5
0
        protected void grdBookingDetail_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e)
        {
            if (e.Column.FieldName == "RowStatus")
            {
                e.Editor.Value = 1;
            }
            if (e.Column.FieldName == "AccountId!Key")
            {
                ASPxComboBox combo = (ASPxComboBox)e.Editor;

                //combo.ItemsRequestedByFilterCondition += new ListEditItemsRequestedByFilterConditionEventHandler(AccountItemsRequestedByFilterCondition);
                //combo.ItemRequestedByValue += new ListEditItemRequestedByValueEventHandler(AccountItemRequestedByValue);

                ASPxComboBox accountCombobox = e.Editor as ASPxComboBox;
                accountCombobox.TextField  = "Code";
                accountCombobox.DataSource = AccountingBO.getNotParentAccountList(session);
                accountCombobox.DataBind();

                e.Editor.Focus();
            }
        }