Example #1
0
        protected void MOPNum_Combo_Callback(object sender, CallbackEventArgsBase e)
        {
            ASPxComboBox combo = sender as ASPxComboBox;

            string monthyear = MonthYear_Combo.Text;

            if (!string.IsNullOrEmpty(monthyear))
            {
                string[] strarr = monthyear.Split(' ');
                string   month  = strarr[0].ToString();
                string   year   = strarr[1].ToString();

                int monthindex = Convertion.MONTH_TO_INDEX(month);

                combo.DataSource = POClass.DocumentNumber_By_Month_Year(monthindex, year);
            }
            else
            {
                combo.DataSource = POClass.DocumentNumber_By_Month_Year(0, "");
            }

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "PK";
            l_value.Caption   = "PK";
            l_value.Width     = 0;
            combo.Columns.Add(l_value);

            ListBoxColumn l_text = new ListBoxColumn();

            l_text.FieldName = "DocumentNumber";
            l_text.Caption   = "Document Number";
            combo.Columns.Add(l_text);

            combo.Value = "PK";
            combo.Text  = "DocumentNumber";
            combo.DataBind();
            combo.TextFormatString = "{1}";
        }
Example #2
0
        protected void MOPNum_Combo_Init(object sender, EventArgs e)
        {
            ASPxComboBox combo = sender as ASPxComboBox;

            combo.DataSource = POClass.DocumentNumber_By_Month_Year(0, "");

            ListBoxColumn l_text = new ListBoxColumn();

            l_text.FieldName = "DocumentNumber";
            l_text.Caption   = "Document Number";
            l_text.Width     = 150;
            combo.Columns.Add(l_text);

            ListBoxColumn lt2 = new ListBoxColumn();

            lt2.FieldName = "EntityCode";
            lt2.Width     = 0;
            combo.Columns.Add(lt2);

            ListBoxColumn lt3 = new ListBoxColumn();

            lt3.FieldName = "Entity";
            lt3.Width     = 300;
            combo.Columns.Add(lt3);

            ListBoxColumn lt4 = new ListBoxColumn();

            lt4.FieldName = "BU";
            lt4.Caption   = "SSU/BU";
            lt4.Width     = 300;
            combo.Columns.Add(lt4);

            combo.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;
            combo.ValueField     = "DocumentNumber";
            combo.TextField      = "DocumentNumber";
            combo.DataBind();
        }