Exemplo n.º 1
0
        //Bind dropdownlist of All Customer to show data
        private void BindDdlCustomer()
        {
            DataTable ds = new CustomerAction().GetAllCustomers();

            DataRow row = ds.NewRow();

            row[0] = 0;
            row[1] = "--Please select--";
            ds.Rows.InsertAt(row, 0); // add item at INDEX = 0;

            ddlCustomer.DisplayMember = "Name";
            ddlCustomer.ValueMember   = "CustId";
            ddlCustomer.DataSource    = ds; // Bind customer in Customer section

            ddlSelectCustomer.DisplayMember = "Name";
            ddlSelectCustomer.ValueMember   = "CustId";
            ddlSelectCustomer.DataSource    = ds; // Bind customer in Movie Rent Panel

            // Bind customer in Movie Return section **********************************
            ddlAllCust.DisplayMember = "Name";
            ddlAllCust.ValueMember   = "CustId";
            ddlAllCust.DataSource    = ds;
        }