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

2 posts, 0 answers
  1. Matthew
    Matthew avatar
    3 posts
    Member since:
    May 2016

    Posted 21 Jun Link to this post

    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?

     

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1801 posts

    Posted 24 Jun Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top