How can I Hide/Unhide columns in rad grid

7 posts, 0 answers
  1. Sudheep
    Sudheep avatar
    11 posts
    Member since:
    Jul 2008

    Posted 21 Jan 2009 Link to this post

    Hi,

    I am using rad grid, how can I hide or unhide columns.
    I have made the AllowColumnHide to true.

    Regards
    Sudheep

  2. Daniel
    Admin
    Daniel avatar
    4780 posts
    Member since:
    Sep 2012

    Posted 21 Jan 2009 Link to this post

    Hello Sudheep,

    Hide/show columns using client-side approach:
    Client-side API

    Server-side approach. Please find the "Visibility and rendering of columns" part inside.
    Using columns

    Kind regards,
    Daniel
    the Telerik team


    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

  3. DevCraft Release
  4. Sudheep
    Sudheep avatar
    11 posts
    Member since:
    Jul 2008

    Posted 22 Jan 2009 Link to this post

    Hi Daniel,

    Thank you for the help.

    I have gone through the link that you have given. it's working fine. But I am facing problem while reordering for columns are enabled(AllowColumnsReorder).  In the java script the columns are hidden based on the  index.

    Can we hide the columns based on the Unique Column Name ??

    Regards
    Sudheep

  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 23 Jan 2009 Link to this post

    Hello Sudheep,

    You can go through the following forum link I found which refers to a scenario similar to yours. Hopes this gets you started of in the right direction.
    Column visibility selection

    Thanks,
    Shinu.

  6. Daniel
    Admin
    Daniel avatar
    4780 posts
    Member since:
    Sep 2012

    Posted 26 Jan 2009 Link to this post

    Hello Sudheep,

    Test the following code-snippet:

    <script type="text/javascript" language="javascript"
        function Button1_Click() 
        { 
            var radGrid = $find('<%= RadGrid1.ClientID %>'); 
            var table = radGrid.get_masterTableView(); 
            var column = table.getColumnByUniqueName("cbDiscontinued"); 
            table.hideColumn(column.get_element().cellIndex); 
        } 
    </script> 

    Let us know if you need more information.

    Regards,
    Daniel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

  7. bhaskar
    bhaskar avatar
    9 posts
    Member since:
    May 2009

    Posted 01 Dec 2009 Link to this post

    Hi Daniel,

    I have a requirement like

    1.I want to add columns to radgrid on selection of columns from checkboxlist where checkbox list have all the columns needs to be added in radgrid.when i uncheck the columns columns should be disabled from the radgrid.i am using template columns so i am not able to use headercontext menu,in header context menu show colums option it was not showing all the columns available in template column.so i want to select columns from checkbox list ,based on selection columns should be enable/disable..if it possible please send some sample project for this..

    Thanks in advance,
    Bhaskar.

  8. Daniel
    Admin
    Daniel avatar
    4780 posts
    Member since:
    Sep 2012

    Posted 03 Dec 2009 Link to this post

    Hello Bhaskar,

    I'm not sure that I understand your scenario properly. May I ask you to attach a sample project that demonstrates how far you managed to bring your project to? This way I will be able to help you fill the gaps.

    Regards,
    Daniel
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

Back to Top
DevCraft Release