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

[Solved] Expander Column

2 Answers 157 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.
purdav
Top achievements
Rank 1
purdav asked on 26 Jan 2010, 10:11 PM
Hi all,
I have a problem with hierarchy expander column. I have a gridview configured in xaml:

                        <telerikGrid:RadGridView x:Name="rgv01"   
                             telerik:StyleManager.Theme="Office_Blue" 
                             Grid.Row="0"   
                             Grid.RowSpan="2" 
                             MinHeight="400"   
                             RowDetailsVisibilityMode="VisibleWhenSelected" 
                             AutoGenerateColumns="False" 
                             CanUserInsertRows="True" 
                             RowIndicatorVisibility="Collapsed" 
                             CanUserFreezeColumns="False" 
                             ColumnsWidthMode="Auto" 
                             FontSize="9" 
                             IsReadOnly="False"   
                             VerticalGridLinesBrush="#FFFFFFFF" 
                             ShowGroupPanel="False">  
                        </telerikGrid:RadGridView> 

I have buttons to select entity type (table) to show that set ItemsSource by code:

// ... Create some data columns on rgv01 here...  
// ...  
 
rgv01.ItemsSource = dds01.Data;  
 

after a call to a reset code (perhaps to change):

        private void ResetGrid()  
        {  
            rgv01.ItemsSource = null;  
 
            rgv01.ChildTableDefinitions.Clear();  
            rgv01.GroupDescriptors.Clear();  
            rgv01.SortDescriptors.Clear();  
            rgv01.Columns.Clear();  
        } 

All works correctly... on a button (that select a table) I set up a Master/Child relation to show related data (before re-assign ItemsSource property):

            // ...  
            GridViewTableDefinition td = new GridViewTableDefinition();  
            td.Relation = new Telerik.Windows.Data.PropertyRelation("InterviewChoice");  
            rgv01.ChildTableDefinitions.Add(td);  
            // ... 

This work correctly too.
Now, if I configure and load a table that hasn't master/detail records to show (plain table) it shows correctly, then if I click button to show (after reset) a table that has master/detail (with a ChildTableDefinition like the code provided) it works fine, shows the expander column, etc... at this point if I click again the button to show a plain table (always after the reset code) the grid still show the expander column (see attached image) that causing a column shift too....! Seems that there are no ways to hide it...I have made a lot of tests...

Perhaps it is a bug or perhaps I missing something in my "reset" code...

Help please!
Many thanks in advance!!
Davide

2 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 28 Jan 2010, 12:09 PM
Hi purdav,

I have created sample application based on your description and I am able to reproduce it. It seems that RadGridView does not refresh hierarchy indentation after binding to non-hierarchical data. The problem was located and the fixed version will be available with the next  internal build (this Friday).

Best wishes,
Tsvyatko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
purdav
Top achievements
Rank 1
answered on 28 Jan 2010, 02:22 PM
Many many thanks.. Great!!!

Best regards,
Davide

Tags
GridView
Asked by
purdav
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
purdav
Top achievements
Rank 1
Share this question
or