createchildcontrols fires before click event

H

hsnkamal

i have developed a web part using class library.when i clicked a
button it displayed a datagrid.after that i want to edit it.when i
click a edit button it goes to the original position where i the last
button.it means the grid is not visible.when i press a gain that
button it is visible again?can anyone help me to solve this matter?
 
T

Tom John

Hi

You need to ensure that the Grid is created/displayed on every postback.

I am guessing you are creating/displaying the Grid only after the button is
clicked. Maybe set a flag in the ViewState to indicate whether the Grid
should be displayed or not and query that when creating the child controls as
to whether it should be displayed or not. Then use the button click event to
set the ViewState flag.

Hope this helps get you going. If you want a code sample, post what you've
got and I'll help out.

Cheers

Tom John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top