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

RadGrid Show/Hide Columns

0 Answers 212 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tyler
Top achievements
Rank 1
Tyler asked on 06 Aug 2012, 02:45 PM
I'm working on a radgridview and I want the user to be able to have an option to show or hide the columns of the grid withing the application. Is there any property that I can set to true that would do this? If not,  Would the best way to implement this be a context menu? I have no room for a checkbox in the application or anything like that. Any code or suggestions would help. Here is the code I currently have to build the grid in the xaml. I am working in C# WPF.
<telerik:RadGridView Name="ExceptionsListBox" 
                                     IsReadOnly="True"
                                     ReorderColumnsMode="Interactive"
                                     UseLayoutRounding="False"
                                     EnableRowVirtualization="True"
                                     AutoGenerateColumns="False" 
                                     RowIndicatorVisibility="Collapsed"
                                     Background="#FF202020"
                                     RowHeight="20"
                                     GroupPanelBackground="#FF202020"
                                     GroupPanelForeground="white" 
                                     telerik:StyleManager.Theme="Expression_Dark" Grouped="ExceptionsListBox_Grouped">
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Key}"
                                                    Header="Type"/>
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding TypeText}"
                                                    Header="Error" />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Message}"
                                                    Header="Error Message" />
                    </telerik:RadGridView.Columns>
                    <telerik:RadGridView.Resources>
                        <Style TargetType="telerik:GridViewHeaderRow">
                            <Setter Property="MinHeight" Value="15" />
                        </Style>
                        <Style TargetType="telerik:GridViewGroupPanel">
                            <Setter Property="MinHeight" Value="10" />
                            <Setter Property="Height" Value="10" />
                        </Style>
                          
                    </telerik:RadGridView.Resources>
                </telerik:RadGridView>
 

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Tyler
Top achievements
Rank 1
Share this question
or