SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created a webpart with an SPGrid that is created after an onclick event. The grid displays with an "Edit" Button. When I click on the edit button it causes a postback and the grid disappears. How can I change the

share|improve this question
Could you paste the whole web part code here? – Falak Mahmood Jun 7 '12 at 22:48

I hope you're calling the code in right order.

   protected override void CreateChildControls()

       // you code here


       //Important to call this after Control.Add...

       yourgridviewid.PagerTemplate = null;
share|improve this answer
I solved the issue. I was adding the control on a button_click event which was causing a postback and I didn't include the grid on the postback. Thank you for your help. – Walter Johnson Jun 8 '12 at 17:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.