Exemplo n.º 1
0
        private void frmThemHangHoa_Load(object sender, EventArgs e)
        {
            //  https://www.devexpress.com/Support/Center/Question/Details/Q20064/comboboxedit-how-do-you-set-the-datasource

            //  Lookup-edit Đơn vị tính
            BUS_DonViTinh dl = new BUS_DonViTinh();

            cbDVT.Properties.DataSource = dl.DanhSachDVT();

            cbDVT.Properties.DisplayMember = "TenDVT";
            cbDVT.Properties.ValueMember   = "MaDVT";
            cbDVT.Properties.Columns.Add(new LookUpColumnInfo("TenDVT", "Đơn vị tính"));
        }
Exemplo n.º 2
0
        private void frmSuaHangHoa_Load(object sender, EventArgs e)
        {
            //  https://www.devexpress.com/Support/Center/Question/Details/Q20064/comboboxedit-how-do-you-set-the-datasource

            //  Lookup-edit Đơn vị tính
            BUS_DonViTinh dl = new BUS_DonViTinh();

            cbDVT.Properties.DataSource = dl.DanhSachDVT();

            cbDVT.Properties.DisplayMember = "TenDVT";
            cbDVT.Properties.ValueMember   = "MaDVT";
            cbDVT.Properties.Columns.Add(new LookUpColumnInfo("TenDVT", "Đơn vị tính"));


            //  Text-edit đơn giá
            //  https://www.devexpress.com/Support/Center/Question/Details/T227028/how-can-i-format-a-textbox-to-show-currency-and-percent-with-currentculture

            txtDonGia.Properties.DisplayFormat.FormatString = "{0:N0}";
            txtDonGia.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
            txtDonGia.Properties.Mask.EditMask = "n0";
            txtDonGia.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
        }