Home Forums WPF controls Xceed DataGrid for WPF Group Level Indicator Pane doesn’t dissapear

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #23536 |

    I’m using following XAML code…

    <Grid xmlns:xcdg=”http://schemas.xceed.com/wpf/xaml/datagrid&#8221; DockPanel.Dock=”Top” Height=”150″>

    <Grid.Resources>
    <Style TargetType=”{x:Type xcdg:GroupLevelIndicatorPane}”>
    <Setter Property=”Visibility” Value=”Collapsed”/>
    </Style>
    </Grid.Resources>

    <xcdg:DataGridControl x:Name=”SelectInformation” HideSelection=”True” NavigationBehavior=”RowOnly” ReadOnly=”True” />

    </Grid>

    But the Group Level Indicator Pane doesn’t dissapear…

    Is something wrong?

    Imported from legacy forums. Posted by JunHeeLee (had 8787 views)

    User (Old forums)
    Member
    Post count: 23064

    <xceed:DataGridControl.Resources>
    <Style TargetType=”xceed:GroupByControl”>
    <Setter Property=”Visibility” Value=”Collapsed” />
    </Style>
    </xceed:DataGridControl.Resources>

    Imported from legacy forums. Posted by Diego (had 2019 views)

    Xceed Support
    Member
    Post count: 5658

    The style you are using should collapse the GroupLevelIndicatorPane, which is, in TableView, located to the left of groups to display their indentation/level.

    <Style TargetType=”{x:Type xcdg:GroupLevelIndicatorPane}”>
    <Setter Property=”Visibility” Value=”Collapsed”/>
    </Style>

    Are you certain that it is the GroupLevelIndicatorPane that you are trying to hide?

    Imported from legacy forums. Posted by Jenny [Xceed] (had 3240 views)

    User (Old forums)
    Member
    Post count: 23064

    The documentation seems to be incorrect.  When I use this code:

            <Style TargetType=”{x:Type xcdg:GroupLevelIndicatorPane}”>
                <Setter Property=”Visibility” Value=”Collapsed”/>
            </Style>

    The grouping pane does not disappear.  However, when I use this code:

            <Style TargetType=”xcdg:GroupByControl”>
                <Setter Property=”Visibility” Value=”Collapsed” />
            </Style>

    It does disappear.  (This is with Xceed WPF Pro 2.0 ..)

     

    Thanks to Diego above for saving me tons of time trying to get this to work !!

    Imported from legacy forums. Posted by Jared (had 843 views)

    Xceed Support
    Member
    Post count: 5658

    The GroupLevelIndicatorPane appears to the left of the groups to provide indentation, while the GroupByControl appears at the top of the grid to allow column headers to be dragged and groups created. These are 2 different controls so it is quite normal that one does not hide when you try to hide to other [;)]

    Imported from legacy forums. Posted by Jenny [Xceed] (had 686 views)

    User (Old forums)
    Member
    Post count: 23064

    I get an error when I try either one:

     System.InvalidOperationException was unhandled
    Message: Items collection must be empty before using ItemsSource.

     I don’t even know what this is trying to tell me.

    jp

    Imported from legacy forums. Posted by jp (had 686 views)

    Xceed Support
    Member
    Post count: 5658

    The error means that you are trying to bind the grid while there are items in the Items collection. You cannot manually add items to the Items collection AND bind through the ItemsSource property. 

    Imported from legacy forums. Posted by Jenny [Xceed] (had 735 views)

    User (Old forums)
    Member
    Post count: 23064

    hmm.  Then why do I only get the error if I try to hide the groupBy panel?

    Imported from legacy forums. Posted by jp (had 682 views)

    User (Old forums)
    Member
    Post count: 23064

    You can get that error by leaving out the “DataGridControl.View” element in the Xaml. Consider the sample below. If you leave out the bold lines, the Xaml is still valid and it compiles and runs, but gives the same exception you were getting.

                        <DataGrid:DataGridControl.View>
                            <Views:TableView UseDefaultHeadersFooters=”False” >
                                <Views:TableView.FixedFooters>
                                    <DataTemplate>
                                        <DataGrid:InsertionRow />
                                    </DataTemplate>
                                </Views:TableView.FixedFooters>
                            </Views:TableView>
                        </DataGrid:DataGridControl.View>

    hth

    Imported from legacy forums. Posted by Steve (had 1540 views)

    User (Old forums)
    Member
    Post count: 23064

    I’ve been wrestling with this problem as I wanted to change the visibility of the header in code. First off if you don’t give your grid a View it will still work, but you can’t (easily) access the header/footers so your xaml starts to look like this

    <xcdg:DataGridControlName=”dataGridControl1″ />

          <xcdg:DataGridControl.View>

               <xcdg:TableView Theme=”{DynamicResource defaultTheme}” UseDefaultHeadersFooters=”true”/>

         </xcdg:DataGridControl.View>

    </xcdg:DataGridControl>

     Then in code you can use :-

    //Ugly hack to remove the group by box at the top of the grid

    dataGridControl1.View.FixedHeaders.RemoveAt(0);

     Does anyone know a cleaner way of doing this? 

    Imported from legacy forums. Posted by Ian (had 946 views)

    Xceed Support
    Member
    Post count: 5658

    If you set the UseDefaultHeadersFooters property to false, the default GroupByControl will not appear; however, the default ColumnManagerRow will also be removed. I would suggest that you create an implicit style that targets GroupByControl and that sets its Visibility property ton collapsed if you don’t want to bother with defining a view and redefining its headers.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 732 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks Steve. This solved my issue which I’ve been scratching my head over for the last 30 mins.

    Imported from legacy forums. Posted by Bryan (had 1086 views)

    User (Old forums)
    Member
    Post count: 23064

    I had the same problem and Steve’s solution solved it 🙂 

     [quote user=”Steve”]

    You can get that error by leaving out the “DataGridControl.View” element in the Xaml. Consider the sample below. If you leave out the bold lines, the Xaml is still valid and it compiles and runs, but gives the same exception you were getting.

                        <DataGrid:DataGridControl.View>
                            <Views:TableView UseDefaultHeadersFooters=”False” >
                                <Views:TableView.FixedFooters>
                                    <DataTemplate>
                                        <DataGrid:InsertionRow />
                                    </DataTemplate>
                                </Views:TableView.FixedFooters>
                            </Views:TableView>
                        </DataGrid:DataGridControl.View>

    hth

    [/quote]

    Imported from legacy forums. Posted by Michele (had 311 views)

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.