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

How to show and Hide Grid Column at Runtime

4 Answers 579 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nikhil Jain
Top achievements
Rank 1
Nikhil Jain asked on 17 Jan 2011, 08:36 AM
Hi

I want to Know, How can implement the Show and Hide of the particular Column / s at Runtime through checkbox.

Regards 

4 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 17 Jan 2011, 08:44 AM
Hello Nikhil Jain,

Our columns have a property called IsVisible - when this property is set to false the respective column will become invisible. You can access the columns by using the Columns property on RadGridView.

Regards,
Milan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Brian
Top achievements
Rank 1
answered on 18 Jan 2011, 03:25 PM
i used a piece like this to hide during Grouping.

private void inventoryReportGrid_Grouping(object sender, GridViewGroupingEventArgs e)
        {
            
            ColumnGroupDescriptor gd = (ColumnGroupDescriptor)e.GroupDescriptor;
            var column = gd.Column;
            if (e.Action == GroupingEventAction.Place)
            {
                if (column != null)
                {
                    column.IsVisible = false;
                }
            }
            else if (e.Action == GroupingEventAction.Remove)
            {
                if (column != null)
                {
                    column.IsVisible = true;
                }
            }
  
        }
0
David
Top achievements
Rank 1
answered on 20 Jan 2011, 07:55 PM
Hello Milan ,

Do you know the impact of hide the column for print and export? If I hide a column, will it still being printed or exported?

Thx,
David
0
Milan
Telerik team
answered on 21 Jan 2011, 08:19 AM
Hello Nikhil Jain,

If a column is hidden it will not be exported or printed.

Greetings,
Milan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
Nikhil Jain
Top achievements
Rank 1
Answers by
Milan
Telerik team
Brian
Top achievements
Rank 1
David
Top achievements
Rank 1
Share this question
or