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

Possible to toggle column visibilty/editing on a grid with a declarative datasource?

1 Answer 40 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 21 Jun 2016, 06:15 PM

Is it possible to toggle column visibilty/editing on a grid with a declarative datasource?

We have a requirement to show/hide certain columns in tables we'd like to display using a RadGrid.

We also have a requirement to enable/disable the editing of certain columns in tables we'd like to display using a RadGrid.

There is a master table in the database that stores the tablename, columnname, visible (0 or 1), editable (0 or 1) data.

Is it possible to use the values in that master table to control which columns are visible/hidden and to enable/disable the editing of certain columns in a RadGrid that has a declarative datasource?

 

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 24 Jun 2016, 08:53 AM
Hello Matthew,

For achieving the requirement that you have you will most likely have to create your RadGrid programmatically and build the columns structure depending on the values of your master table. Below is a link to our help article for creating RadGrid programmatically:
Another option is to define the grid in the markup and handle the server-side OnColumnCreating event to set the Visible and the ReadOnly properties of each column (based on the master table values from your database).


Best Regards,
Konstantin Dikov
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Matthew
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or