UniGrid Binding

Delford Chaffin asked on August 8, 2016 17:25

I have the following UniGrid on a module page:

<cms:UniGrid ID="ugResponses" runat="server">
    <GridColumns>
        <ug:Column Source="UserID" Caption="User" Wrap="false"></ug:Column>
    </GridColumns>
</cms:UniGrid>

If I put this in the Page_Load:

ugResponses.DataSource = CMS.SiteProvider.UserInfoProvider.GetAllUsers();

... it loads the data to the grid as you would expect. If I put the exact same line in a button click handler, it does nothing. I even tried adding ugResponses.DataBind() in the click handler and still nothing.

Any thoughts on why this is happening?

Thanks!

Correct Answer

Delford Chaffin answered on August 8, 2016 17:31

Found the answer here:

http://devnet.kentico.com/questions/fill-unigrid-with-data-from-external-web-service

In my click handler, I had to add ugResponses.ReloadData() in addition to ugResponses.DataBind().

0 votesVote for this answer Unmark Correct answer

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