GridView updating when data associated with data source changes

Posts   
 
    
Posts: 254
Joined: 16-Nov-2006
# Posted on: 24-Mar-2007 20:11:36   

Guys,

I have a GridView however to show the detail information I have decided not to use a FormView / DetailsView as the detail is quite complex and covers a few nested grids (seem to have more issues getting data binding work this way )

However if I change some of the detail information when I press the update button I can't get the GridView to update. I have code such as

  AspnetMembershipEntity userMember = new AspnetMembershipEntity(UserIdEditing);
        userMember.User.TelephoneNo = telephoneNoTextBox.Text;
        userMember.User.Name        = nameTextBox.Text;
        userMember.Save(true);

I tried a number of things immediately after this code

1) Calling DataBind on the GridView. However I didn't set the DataSource property at this time as the DataSourceID is already set to an LLBLGenDataSource control.

2) Calling DataBind on the Data source control.

3) Setting the Refresh property on the Data source control to true

I'm also using Self Serviciing if this matters.

Cheers

Matt

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 25-Mar-2007 04:10:30   

Hi Matt. Could you please put your aspx code of the LLBLGenDataSource and GridView. Why are you using LLBLGenDataSource if you dont use it as mediator between Control and Collection?. I mean, for your code above you could simply bind to an EntityCollection. Or maybe I don't understand your real scenario.

David

David Elizondo | LLBLGen Support Team
Posts: 254
Joined: 16-Nov-2006
# Posted on: 26-Mar-2007 14:10:46   

Sure I've attached the code.

I just thought the control was slightly better to use because of the design time support although i guess theres not much in either approach here?

I thought the code attached should work though soI 'm unclear why it doesn't

Attachments
Filename File size Added on Approval
ManageUsers.aspx 5,939 26-Mar-2007 14:11.02 Approved
Posts: 254
Joined: 16-Nov-2006
# Posted on: 26-Mar-2007 14:12:09   

Not sure why I couldn't attach both files to the last message however here is the second one for the code behind.

Attachments
Filename File size Added on Approval
ManageUsers.aspx.cs 10,505 26-Mar-2007 14:12.21 Approved
Posts: 254
Joined: 16-Nov-2006
# Posted on: 26-Mar-2007 22:45:13   

Any thoughts?

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 27-Mar-2007 05:23:10   

Does perform select not get fired when you click update?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 27-Mar-2007 10:12:11   

What's the runtime lib version you're using? We recently released an update of the runtime which might fix this, as it's likely an event related issue.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 254
Joined: 16-Nov-2006
# Posted on: 27-Mar-2007 10:35:11   

The SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll is 2.0.7.219

No PerformSelect event is raised because LivePersistence is true.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 27-Mar-2007 10:53:53   

Could you try with the current builds of the runtime lib? We fixed an issue on March 17, which changed event raising and also fixed an issue where your code could dive into an infinite loop.

THe event I'm talking about is the changed event from the datasourcecontrol simple_smile . THis event has to be raised when the data is changed inside the control. It turned out we did route some events wrong so it could be the bound grid doesn't receive a changed event even though the data in the datasource control changed after an update / insert etc.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 254
Joined: 16-Nov-2006
# Posted on: 27-Mar-2007 11:10:10   

Sure, how do I actually get hold of the latest runtime libraries? Im a registered licensed customer.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 27-Mar-2007 12:02:22   

MattAdamson wrote:

Sure, how do I actually get hold of the latest runtime libraries? Im a registered licensed customer.

Customer area -> 2.0 -> Runtime libs section simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Posts: 254
Joined: 16-Nov-2006
# Posted on: 27-Mar-2007 21:45:01   

That seemed to work thanks. I'll always try the latest version now when reviewing any issues.