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

How to programmatically choose which columns of a table to display?

2 Answers 133 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Neal Campbell
Top achievements
Rank 1
Neal Campbell asked on 14 Mar 2010, 04:37 PM
I am converting an old program (c++ MFC/Rogue Wave) to C#/Telerik. The old program gives users the options of deciding which columns of a data table to display at run-time. For my audience, the Column Chooser mechanism is too complicated for them to you, plus they are already used to a set of checkbox specifications in the setup routine.

So how can I, during form load event, choose which columns to display while still enjoy the automatic CRUD actions performed by databinding?

Bes6 wishes
Neal Campbell

2 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 15 Mar 2010, 10:04 AM
Hi Neal Campbell,

In this case you should set the IsVisible property of GridViewColumn. Here is a sample:

this.radGridView1.Columns["Name"].IsVisible = false;

I hope this helps. If you need further assistance, please write back.

All the best,
Jack
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Neal Campbell
Top achievements
Rank 1
answered on 15 Mar 2010, 05:31 PM
Thanks so much, I was looking at the gridview instead of the gridcolumnview attributes!

Best wishes
Neal
Tags
GridView
Asked by
Neal Campbell
Top achievements
Rank 1
Answers by
Jack
Telerik team
Neal Campbell
Top achievements
Rank 1
Share this question
or