This question is locked. New answers and comments are not allowed.
I have successfully bound a template column with some value conversion. The value converter extracts a value from the raw string to display in the column template.
The problem is - if I sort the grid by this column or any other column the converted value does not change. Basically - the display doesnt change. The underlying value (Raw) does change....
Is there a way to force a refresh of the display in the cell template?
Couple of restrictions - the dataset and its contents are 100% dynamic, I do not know at run time if I'm going to use this column/cell template.
Here is the code behind for my column binding:
Here is the code behind on GridDrillDownButton
I would appreciate any tips to get me moving in the right direction
The problem is - if I sort the grid by this column or any other column the converted value does not change. Basically - the display doesnt change. The underlying value (Raw) does change....
Is there a way to force a refresh of the display in the cell template?
Couple of restrictions - the dataset and its contents are 100% dynamic, I do not know at run time if I'm going to use this column/cell template.
Here is the code behind for my column binding:
Dim sStyleString As String sStyleString = "<Style TargetType=""grid:GridViewCell"" xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"" " & _ "xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" " & _ "xmlns:Results=""clr-namespace:SL.Product.ReportResult;assembly=SL.Product.ReportResult"" " & _ "xmlns:grid=""clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"" >" & _ "<Setter Property=""Template"">" & _ "<Setter.Value>" & _ "<ControlTemplate>" & _ "<Border BorderThickness=""0,0,1,1"" BorderBrush=""#FFD2CFCF"">" & _ "<Results:GridDrillDownButton SourceReportID=""" & ReportID & """ DisplayContent=""{Binding " & repfield.RenamedField & "}"" />" & _ "</Border>" & _ "</ControlTemplate>" & _ "</Setter.Value>" & _ "</Setter>" & _ "</Style>" Dim s1 As System.Windows.Style = DirectCast(System.Windows.Markup.XamlReader.Load(sStyleString), System.Windows.Style) column.SortMemberPath = repfield.RenamedField column.CellStyle = s1Here is the code behind on GridDrillDownButton
Imports Telerik.Windows.ControlsImports SL.Product.UIHelperPartial Public Class GridDrillDownButton Inherits UserControl Public DisplayContentProperty As DependencyProperty = DependencyProperty.Register("DisplayContent", GetType(String), GetType(GridDrillDownButton), Nothing) Public SourceReportProperty As DependencyProperty = DependencyProperty.Register("SourceReportID", GetType(String), GetType(GridDrillDownButton), Nothing) Private switch As Boolean Private oRadWindow As Telerik.Windows.Controls.RadWindow Public Property SourceReportID() As String Get Return GetValue(SourceReportProperty) End Get Set(ByVal value As String) SetValue(SourceReportProperty, value) End Set End Property Public Property DisplayContent() As String Get Return GetValue(DisplayContentProperty) End Get Set(ByVal value As String) SetValue(DisplayContentProperty, value) End Set End Property Public Sub New() InitializeComponent() End Sub Private Sub lnkDisplay_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles lnkDisplay.Click Try If Not String.IsNullOrEmpty(DisplayContent) Then If SourceReportID = "" Then MessageBox.Show("You must save your report first before you can click the Drill Down field.", "Warning", MessageBoxButton.OK) Exit Sub End If Dim oResultWindow As New SL.Product.ReportResult.ReportResult(SourceReportID, DisplayContent) oRadWindow = New RadWindow oRadWindow.Style = SL.Product.SharedDataLibrary.GlobalUIElements.ProductRadWindowTransparentStyle oRadWindow.Height = UIElementHelper.MainGrid.ActualHeight - 50 oRadWindow.Width = UIElementHelper.MainGrid.ActualWidth - 50 oRadWindow.WindowState = WindowState.Normal oRadWindow.ResizeMode = ResizeMode.NoResize oRadWindow.CanMove = False oRadWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner oRadWindow.Content = oResultWindow oRadWindow.ShowDialog() ' oResultWindow.ShowResultWindow() End If Catch ex As Exception End Try End Sub Private Sub lnkDisplay_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles lnkDisplay.Loaded Try Dim aryBoundString() As String = Split(DisplayContent, "||") 'validate '0 = TargetReportID '1 = Fields Array '2 = Use Criteria '3 = Display Value Dim aryTemp() As String = Split(aryBoundString(3), "=") lnkDisplay.Content = String.Empty If aryTemp(0).ToUpper = "DISPLAY" Then lnkDisplay.Content = aryTemp(1).ToString Catch ex As Exception lnkDisplay.Content = String.Empty ToolTipService.SetToolTip(lnkDisplay, "Error Processing Display Value: " & ex.Message) End Try End Sub End ClassI would appreciate any tips to get me moving in the right direction
