Gilderoy Lockhart is a fictional character from the Harry Potter Universe.
Gilderoy Lockhart as played by Kenneth Brannagh.
It is unknown if Gilderoy Lockhart ever even attended Hogwarts, seeing as how he is a terrible wizard. The only art of magic he seems to know is Mind Altering; however, he seems like he is actually quite excellent at this. He is known to be a frequent liar and quite a coward.
In 1992, Lockhart was appointed teacher at Hogwarts, teaching the Defence Against the Dark Arts subject. However, he seems quite unqualified for the job, as he isn't any good with spells. He is chosen whatsoever as he is the only applicant to the position. He first meets Harry Potter before taking on the job, as Harry buys his new school supplies, as Lockhart is the author of lots of famous books. He tells the press to take lots of photos of the two together, surely to raise his own popularity. When Harry is having detention with Lockhart, he has to help him sign amazingly huge quantities of fan mail.
In the first lesson, Lockhart hands out a test to the students. However, the test is just a quiz about how much the students now about their famous teacher. He also brings a cage of pixies into the class, carelessly releasing them, creating much chaos. After this, most of the lessons were just Lockhart reading from a book.
Lockhart continously looks at Harry as his apprentice, explaining that everything Harry does is just for the publicity boost. When Harry's arm is injured during a Quidditch match, Lockhart quickly rushes towards Harry to heal it (even though Harry begs for someone else to do it), accidentally removing all bones from Harry's arm completely. Lockhart tries to comfort Harry by telling him that at least, the arm is no longer "broken".
Lockhart also founded a dueling club for students. Introducing the club to the audience, he dares to challenge Severus Snape to a duel. As Snape, almost bored, disarms him, Lockhart tells the believing crowd that it was just a part of the plan.
As arrogant as he was, he was asked to go down into the Chamber of Secrets when Ginny Weasley was captured. He said he was going to do it, but instead started packing his stuff, ready to leave. He is found by Ron and Harry who tell him to go with them to the Chamber to save Ron's sister. Lockhart tries to trick them, and the two young learn that everything Lockhart ever wrote was just taken from other, brave wizards who Lockhart met, heard the story from, and "modified" their memories. Ron and Harry lift their wands at Lockhart (in the book used the disarming spell learned from Snape), now commanding him to go with them.
After making him slide down into the entrance in the bathroom, he manages to take Ron's wand from him, unknowing of the fact that it is broken and not functioning quite well. He proceeds to erase their memories when the wand fires back at him, completely deleting his memory. Unfortunately, the spell also released a load of rocks which trapped Ron with Lockhart. He continues to ask Ron silly questions until they are saved by Fawkes.
Shortly thereafter, Lockhart is taken to St. Mungo's and becomes a patient there. He is kept in the locked section for wizards who reside at the hospital permanently, as they will probably take a very long time to (or will never) recover. He was placed together with Neville Longbottom's parents, who were tortured to insanity by Bellatrix Lestrange. The Trio + Ginny accidentally pays him a visit, learning that he is still as confused as before. He is still receiving loads of fan mail from one person, but has no idea why.