dipika29 wrote:I know that we need to re-create them on postback but the issue is how to get the data in textbox entered by the user
Yes, just re-create the grid and controls and then based on the row selected, find the textbox, you should be able to get the data. Make sure the ViewState of the textbox is enabled.
2. Now, whenever textbox data is changed, this JS will be called and in this JS function you can store the textbox value in a Hidden field (hdF1). Also store the grid row index or row identifier in another hidden field (hdF2)
3. After the page postbacks and you have re-created the grid. Use the hdF2 to get to the row and then hdF1 to set back the value of the textbox.
Further, make sure if there were any server events of the dynamically created control then on postback you re-bind the events. Once done, they will be called and executed.