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

[Solved] Hiding and showing column using client api

4 Answers 154 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shane
Top achievements
Rank 1
Shane asked on 22 Jan 2008, 03:36 AM
Hi Guys,

I have a GridClientSelectColumn and I don't want to display at the start, and we a user click on a button, the GridClientSelectColumn should show.

Few problems:
1. I can hide the column at the start using visible or display property. But I am unable to display the column back using
 var column1 = $find("<%=rg.ClientID %>").get_masterTableView().get_columns()[0]; 
        column1.set_visible(true) 
         

2. When I hide the column, the space still occupied!

Basically, I would like to hide and show a column using client API.

Is this possible? Please advise me!

Cheers,
Shane


4 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 24 Jan 2008, 11:50 AM
Hi Shane,

Attached to this message is a sample application, which handles the necessary functionality.
I hope it helps.

All the best,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Shane
Top achievements
Rank 1
answered on 24 Jan 2008, 10:58 PM
Hi Yavor,

You are a legend!

How do I toggle the display? I could show the column using RadGri1.get_masterTableView().showColumn(2); 

But how do I get the display property? so I can toggle accordingly!

Thanks for you help Yavor :)

Cheers,
Shane
0
Yavor
Telerik team
answered on 25 Jan 2008, 12:10 PM
Hi Shane,

You can get the display attribute as shown in the following snippet:

.Js
RadGri1.get_masterTableView().get_columns()[2].Display

I hope this helps.

Sincerely yours,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Shane
Top achievements
Rank 1
answered on 28 Jan 2008, 10:17 PM
Thanks Yavor!

Cheers,
Shane
Tags
Grid
Asked by
Shane
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Shane
Top achievements
Rank 1
Share this question
or