iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi
When I click the refresh button of UXGridView, the data is reloaded, but the view is not refreshed! Cache problem? How can I change this behavior?
This is the response from domain service:
000003B0 06 00 00 00 00 00 00 9F 02 1C 5B 01 5F 0E 50 72 ..........[._.Pr000003C0 6F 64 75 63 74 69 6F 6E 4C 69 6E 65 5F 04 48 69 oductionLine_.Hi000003D0 64 65 85 5F 02 49 44 99 24 32 35 64 61 30 33 33 de._.ID.$25da033000003E0 62 2D 37 31 38 61 2D 36 33 61 37 2D 62 37 31 33 b-718a-63a7-b713000003F0 2D 32 34 64 35 62 62 32 32 34 36 30 62 5F 04 4E -24d5bb22460b_.N00000400 61 6D 65 99 09 53 4C 52 20 4C 69 6E 69 65 5F 07 ame..SLR Linie_.00000410 56 65 72 73 69 6F 6E 9E 06 00 00 00 00 00 00 9F Version.........00000420 02 1C 5A 01 5F 0E 50 72 6F 64 75 63 74 69 6F 6E ..Z._.Production00000430 4C 69 6E 65 5F 04 48 69 64 65 85 5F 02 49 44 99 Line_.Hide._.ID.00000440 24 64 39 62 36 66 37 35 65 2D 35 33 37 33 2D 34 $d9b6f75e-5373-400000450 30 65 37 2D 39 33 34 64 2D 31 35 39 38 35 31 30 0e7-934d-159851000000460 62 38 36 62 61 5F 04 4E 61 6D 65 99 07 58 58 58 b86ba_.Name..XXX00000470 58 31 32 33 5F 07 56 65 72 73 69 6F 6E 9E 06 00 X123_.Version...00000480 00 00 00 00 00 9F 02 27 1E 01 01 01 01 .......'.....
The UXGridView shows still XXXX00. Have a look at attached picture.
reproducible test steps:
- Load data- Record changed directly into SQL DB (Simulation of multiuser application)- Refresh button clicked
Environment:
- SQL Server 2008 R2- Entity Framework 4- Domainservice (Ria Services)- ClientUI MVVM Business Application (Silverlight)
Refresh Button works fine with "new item" and "delete item". This behavior occurs only with "edit item".
Regards
Michael
Following section shows the steps to bind the refresh button to a command that will refresh data and clear the cache. Specifically the “clear cache” mechanism is done by clearing the contents of entity set.
Note: the step-by-step made based on the “Intersoft ClientUI MVVM Data Application (WCF RIA SP1).
<Intersoft:UXStatusBarItem> <Intersoft:UXFlatButton Command="core:DataViewCommands.Refresh" Icon="/Intersoft.Client.UI.Data;component/Resources/refresh.png" Style="{StaticResource CommandButtonStyle}"/> </Intersoft:UXStatusBarItem>
<Intersoft:UXStatusBarItem> <Intersoft:UXFlatButton Command="{Binding RefreshCommand}" Icon="/Intersoft.Client.UI.Data;component/Resources/refresh.png" Style="{StaticResource CommandButtonStyle}"/> </Intersoft:UXStatusBarItem>
#region Commands ... /// <summary> /// Gets or sets a <see cref="DelegateCommand"/> to handle refresh operation. /// </summary> public DelegateCommand RefreshCommand { get; set; } #endregion
#region Methods ... private void ExecuteRefresh(object parameter) { this.DataSource.Context.EntityContainer.Clear(); this.LoadData(); } #endregion
#region Constructor /// <summary> /// Initializes a new instance of the <see cref="EditableGridViewModelBase"/> class. /// </summary> public EditableGridViewModelBase() : base() { ... this.RefreshCommand = new DelegateCommand(ExecuteRefresh); } #endregion
public interface IDataRepository { ... DomainContext Context { get; } }
I have tested this approach on my local end. Please kindly let me know if you find any difficulties to implement this. I’d be glad to send you a working sample.
Thank you and have a nice day.
Hi Yudi
Thanks for excellent support!
I have skipped the first three steps, because I've bound the command directly to the UXGridView (see last line of code). It works fine.
<Intersoft:UXGridView Intersoft:DockPanel.IsFillElement="True" AutoGenerateColumns="False" Style="{StaticResource UXGridViewStyle}" IsBusy="{Binding IsBusy, Mode=TwoWay}" IsRefreshed="{Binding IsRefreshed, Mode=TwoWay}" SortDescriptors="{Binding QueryDescriptor.SortDescriptors, Mode=TwoWay}" PageDescriptor="{Binding QueryDescriptor.PageDescriptor}" FilterDescriptors="{Binding QueryDescriptor.FilterDescriptors, Mode=TwoWay}" PageSize="{Binding ElementName=PageSize, Path=Text}" ItemsSource="{Binding Path=Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" NewItem="{Binding NewItem, Mode=TwoWay}" HasChanges="{Binding HasChanges}" AutoEditOperation="{Binding AutoEditOperation}" PrepareNewRowCommand="{Binding PrepareNewRowCommand}" ValidateRowCommand="{Binding ValidateRowCommand}" InsertRowCommand="{Binding InsertRowCommand}" DeleteRowCommand="{Binding DeleteRowCommand}" UpdateCellCommand="{Binding UpdateCellCommand}" UpdateRowCommand="{Binding UpdateRowCommand}" SaveChangesCommand="{Binding SaveChangesCommand}" RejectRowCommand="{Binding RejectRowCommand}" RejectChangesCommand="{Binding RejectChangesCommand}" RefreshCommand="{Binding RefreshCommand}">
This problem is not caused by the cache problem.
The “Refresh” button in our UXGridView sample or project template is not bind to any command (refresh command) yet. You can try to add your own command that will, for example, clear the cached data and then reload the data.
Hope this helps.
Yes, I have seen that UXGridView refresh command is not bind. But if I click on refreshbutton, a request is running (see my first post). Can I not use this query directly? Run the query twice after?
Apologize for lack of understanding about the required scenario.Could you please kindly add more detail about the terms “Can I not use this query directly? Run the query twice after?”
This command is overridden with UXGridView refresh command? I had thought it would run both commands...
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname