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

How can I Hide/Unhide columns in rad grid

6 Answers 1422 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Sudheep
Top achievements
Rank 1
Sudheep asked on 21 Jan 2009, 02:24 PM
Hi,

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

Regards
Sudheep

6 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 21 Jan 2009, 05:07 PM
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.
0
Sudheep
Top achievements
Rank 1
answered on 22 Jan 2009, 10:43 AM
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
0
Shinu
Top achievements
Rank 1
answered on 23 Jan 2009, 04:11 PM
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.
0
Daniel
Telerik team
answered on 26 Jan 2009, 09:51 AM
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.
0
bhaskar
Top achievements
Rank 1
answered on 01 Dec 2009, 07:09 AM
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.
0
Daniel
Telerik team
answered on 03 Dec 2009, 08:47 PM
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.
Tags
Chart (Obsolete)
Asked by
Sudheep
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Sudheep
Top achievements
Rank 1
Shinu
Top achievements
Rank 1
bhaskar
Top achievements
Rank 1
Share this question
or