This question is locked. New answers and comments are not allowed.
Are there any alternatives to updating the grid other than .Rebind()? The method below that I am using locks up the UI during the refresh every 10 seconds and doesnt seem like a smooth way to update the grid with backend data changes. The cell value does infact update automatically but I need the cell background color to change with it depending on a true or false value. This works fine when the grid loads and during a rebind but not automatically during a domain data source refresh.
I am using WCF RIA Services and am declaring the Domain Data Source as follows, Notice the use of RefreshInterval.
And in Code Behind I am calling rebind as follows, Notice the use of .IsBusy = False. I do this to avoid getting a Grid.Busy on screen every 10 seconds when the routine is called during Domain Data Source Refresh.
My customcolumn is as below,
Please help.
I am using WCF RIA Services and am declaring the Domain Data Source as follows, Notice the use of RefreshInterval.
<riaControls:DomainDataSource AutoLoad="True" x:Name="Event1DomainDataSource" RefreshInterval="00:00:10" QueryName="GetEvent1Query" d:IsHidden="True"> <riaControls:DomainDataSource.DomainContext> <my:DomainService1 /> </riaControls:DomainDataSource.DomainContext> </riaControls:DomainDataSource>And in Code Behind I am calling rebind as follows, Notice the use of .IsBusy = False. I do this to avoid getting a Grid.Busy on screen every 10 seconds when the routine is called during Domain Data Source Refresh.
Private Sub Event1DomainDataSource_LoadingData(ByVal sender As Object, ByVal e As System.Windows.Controls.LoadingDataEventArgs) Handles Event1DomainDataSource.LoadingData e.LoadBehavior = MergeOption.PreserveChanges CheckListItemssDataGrid.Rebind() CheckListItemssDataGrid.IsBusy = False End SubMy customcolumn is as below,
Imports System Imports System.Net Imports System.Windows Imports System.Windows.Controls Imports System.Windows.Documents Imports System.Windows.Ink Imports System.Windows.Input Imports System.Windows.Media Imports System.Windows.Media.Animation Imports System.Windows.Shapes Imports Telerik.Windows.Controls Imports Telerik.Windows.Controls.GridView Imports System.Windows.Controls.Primitives Public Class CustomColumn Inherits GridViewDataColumn Public Overrides Function CreateCellElement(ByVal cell As GridViewCell, ByVal dataItem As Object) As FrameworkElement cell.SetBinding(GridViewCell.ValueProperty, Me.DataMemberBinding) If cell.Value = "True" Then cell.Background = New SolidColorBrush(Colors.Green) ElseIf cell.Value Is Nothing Then cell.Background = New SolidColorBrush(Colors.LightGray) End If End FunctionEnd ClassPlease help.
