Unigrid, DataGrid, lose data after postback

Luca Dell'Angelo asked on July 18, 2014 18:39

Hi, I used Unigrid control within a Kentico webpart. That control loses data after postback if the databind method is only performed within load event (if (!IsPostback) condition). The same code works fine within a standard aspx page. I also tried the UserControlWebpart but got the same problem even, using DataGrid aspnet standard control. How can I resolve that problem?

Thank you

Recent Answers


Brenden Kehren answered on July 18, 2014 19:07

With webparts, you need to load the data each time, simply remove your IsPostback() condition and you'll be set.

0 votesVote for this answer Mark as a Correct answer

Luca Dell'Angelo answered on July 21, 2014 10:10 (last edited on July 21, 2014 10:10)

Hi Brenden, Your answer is obviously correct but with large dataset would cause performance problems

Thanks

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 21, 2014 13:40

Then you might use caching or other means to store your data in memory, either way you need to bind the dataset to the datasource each time.

2 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.