I have a bound data repeater and want to change the value of a variable once the data is completely loaded/drawn/bound to the repeater.
If I use the datasourcechanged event my variable changes before all of the data in the repeater template controls is loaded. Does that make sense?
To say it another way, I have a boolean “IsLoading” variable that is set to true while the repeater datasource is being set. While this “IsLoading” variable is true, I want to ignore all “Text_Changed” events that fire when a user changes a value of one of the controls inside the repeater template. But again, if I use the datasource changed event, or set the variable to true before setting the datasource, and then to false after it sets, the “Text_Changed” event fires for every control on the template after all this occurrs, and the “IsLoading” variable is already false.
So is there an event that can be fired after the repeater is completely done loading, or is there a much more elegant way to go about what I’m trying to do here?
Hi,
Wisej.NET doesn’t draw anything, ItemCloning is fires only when new items are cloned and that is only what’s needed for the view. You can have 1M items and 5 ItemCloning events if the DataRepeater only needs 5 panels.
HTH,
Alaa
I’m looking forward to this event too.
For now I use (might not be the best approach but works kinda):
Private Sub DataRepeater1_ItemCloning(sender As Object, e As DataRepeaterItemCloneEventArgs) Handles DataRepeater1.ItemCloning
If DataRepeater1.ShowLoader = False Then
DataRepeater1.ShowLoader = True
Application.Update(Me)
End IfEnd Sub
Private Sub DataRepeater1_ItemCloned(sender As Object, e As DataRepeaterItemEventArgs) Handles DataRepeater1.ItemCloned
DataRepeater1.ShowLoader = False
End Sub
There is no DataBindingComplete event like the DataGridView. The data binding is ongoing since it’s a completely virtual system: only the visible panels are created and then continually reused while the user scrolls. You can scroll 1M panels and the control only creates 5, for example. The data is always coming from the data source.
When a new panel is needed, there is the ItemCloning and ItemCloned event. If 5 items fits in the view + PrefetchItems then you get 5 ItemCloned events only. When an item is populated with the data from the data source there is the ItemUpdate event. It fires everytime an item is updated from the data source. If you have 5 items in view and 1M rows then ItemUpdate is fired every time an item is reused. It is fired after the update so when you process that event the data in the controls is already correct.
You could handle the update cycle this way, override the DataRepeater in your class, say DataRepeaterEx:
protected override void OnWebEvent(WisejEventArgs e) { if (e.Type == "update") { // updating items in view. base.OnWebEvent(e); // done updating items in view. } else{ base.OnWebEvent(e); } }
We may add an event for that actually, seems like a good thing to have.
Please login first to submit.