This is a migrated thread and some comments may be shown as answers.

[Solved] HierarchyExpandButtonStyleSelector is called for every data update in 2010 Q3 SP1, but only called once in 2011 Q1 SP1

3 Answers 143 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ron
Top achievements
Rank 2
Ron asked on 06 Jul 2011, 09:35 PM
I tried upgrading to 2011 Q1 SP1 again today, but was forced to regress again because of a change in functionality.

Here's the situation:

A hierarchial grid, and I want to change the expand button to indicate that there are child elements.  So, I tie into the cellstyle selector using
HierarchyExpandButtonStyleSelector="{StaticResource cellStyleSelector}"

with the following code behind
Public Class MyCellStyleSelector
    Inherits StyleSelector
    Public Overloads Overrides Function SelectStyle(item As Object, container As System.Windows.DependencyObject) As System.Windows.Style
 
        Dim style As New Style(GetType(GridViewToggleButton))
        Dim backgroundBrush As New LinearGradientBrush()
        Dim foregroundBrush As New SolidColorBrush()
        Dim borderBrush As New LinearGradientBrush()
 
        backgroundBrush = Application.Current.Resources("GridView_PopulatedToggleButtonBackground")
        foregroundBrush = Application.Current.Resources("GridView_PopulatedToggleButtonForeground")
        borderBrush = Application.Current.Resources("GridView_PopulatedToggleButtonBorder")
 
        Dim CurrentRowData As BillComponent = TryCast(item, BillComponent)
        If CurrentRowData IsNot Nothing Then
            If CurrentRowData.ReferenceDesignators IsNot Nothing AndAlso CurrentRowData.ReferenceDesignators.Count > 0 Then
                style.Setters.Add(New Setter(GridViewCell.BackgroundProperty, backgroundBrush))
                style.Setters.Add(New Setter(GridViewCell.ForegroundProperty, foregroundBrush))
                style.Setters.Add(New Setter(GridViewCell.BorderBrushProperty, borderBrush))
            End If
        End If
 
        Return style
    End Function


In 2010 Q3 SP1 this code gets called everytime the underlying data is changed... say I have a function that sorts the rows. 
In 2011 Q1 SP1 this code only gets called when the grid is loaded.

I've even used a .Rebind() with no luck.

3 Answers, 1 is accepted

Sort by
0
Yordanka
Telerik team
answered on 13 Jul 2011, 11:37 AM
Hi Ron,

We are currently investigating the problem and will contact you as soon as we have more information.

Kind regards,
Yordanka
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Ron
Top achievements
Rank 2
answered on 20 Jul 2011, 08:53 PM
I just tried it in Q2 2011, same problem.  Either the Q3 2010 version should not have called row_loaded everytime the data changed and it was fixed, or it's still broken.
0
Milan
Telerik team
answered on 25 Jul 2011, 09:01 AM
Hi Ron,

We isolated the issue and it have been fixed already. The fix will be available with today's Internal Build.

 

Greetings,
Milan
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
GridView
Asked by
Ron
Top achievements
Rank 2
Answers by
Yordanka
Telerik team
Ron
Top achievements
Rank 2
Milan
Telerik team
Share this question
or