databind with TypedView

Posts   
 
    
Posts: 2
Joined: 07-Dec-2007
# Posted on: 07-Dec-2007 17:44:15   

Hello,

I have a gridview which I bind to TypedView using LLBLGenProDataSource. I have checkboxes for selecting rows and a submit button, which updates the database (using entities). After submitting, when I say GridView1.DataBind(), it doesn't show the updated data, but the same data as the first time. Why?

This is the datasource :

<llblgenpro:LLBLGenProDataSource ID="LLBLGenProDataSource1" runat="server" DataContainerType="TypedView" TypedViewTypeName="<dbname>.LLBLPro.TypedViewClasses.CandidateApproveAppTypedView, <dbname>.LLBLPro"> <SelectParameters> <asp:SessionParameter Name="JurisdictionId" SessionField="JurisdictionId" /> </SelectParameters> </llblgenpro:LLBLGenProDataSource>

Thanks.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 08-Dec-2007 07:47:33   

I suppose you are using SelfServicing. GridView.DataBind() refresh the grid with the underlying collection. However, the collection (typedview in this case) will remain the same unless you perform a select again. In resume you have to refetch your typedView again.

If you bind to a EntityCollection you can avoid this perfoming a Save setting to true the refetch parameter.

David Elizondo | LLBLGen Support Team
Posts: 2
Joined: 07-Dec-2007
# Posted on: 10-Dec-2007 19:09:14   

Thanks so much for your help. I have to use a view for my grid since the data is coming from several different tables with a few criterias. I did LLBLGenProDataSource1.Refetch = true; Gridview1.DataBind();

and it is working fine now. Thanks again.