private void FillComboBox(GridViewRowEventArgs e)
        {
            EditorialManager managerEditorial = new EditorialImpXMLManager();
            AuthorManager    managerAuthor    = new AuthorImpXMLManager();
            GenreManager     managerGenre     = new GenreImpXMLManager();


            DropDownList AuthorDrop    = (DropDownList)e.Row.FindControl("AuthorDropDown");
            DropDownList GenreDrop     = (DropDownList)e.Row.FindControl("GenreDropDown");
            DropDownList EditorialDrop = (DropDownList)e.Row.FindControl("EditorialDropDown");

            if (AuthorDrop != null)
            {
                AuthorDrop.DataSource     = managerAuthor.FindAll();
                AuthorDrop.DataTextField  = "Name";
                AuthorDrop.DataValueField = "Id";
                AuthorDrop.DataBind();
            }

            if (GenreDrop != null)
            {
                GenreDrop.DataSource     = managerGenre.FindAll();
                GenreDrop.DataTextField  = "Description";
                GenreDrop.DataValueField = "Id";
                GenreDrop.DataBind();
            }

            if (EditorialDrop != null)
            {
                EditorialDrop.DataSource = managerEditorial.FindAll();

                EditorialDrop.DataTextField  = "Name";
                EditorialDrop.DataValueField = "Id";
                EditorialDrop.DataBind();
            }



            dpGenre.DataSource = managerGenre.FindAll();

            dpGenre.DataTextField  = "Description";
            dpGenre.DataValueField = "Id";
            dpGenre.DataBind();

            dpEditorial.DataSource = managerEditorial.FindAll();

            dpEditorial.DataTextField  = "Name";
            dpEditorial.DataValueField = "Id";
            dpEditorial.DataBind();


            dpAuthor.DataSource = managerAuthor.FindAll();

            dpAuthor.DataTextField  = "Name";
            dpAuthor.DataValueField = "Id";
            dpAuthor.DataBind();
        }
Example #2
0
        private void BindGrid()
        {
            AuthorManager manager = new AuthorImpXMLManager();

            GridView1.DataSource = manager.FindAll();
            GridView1.DataBind();
        }