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

[Solved] radgrid column hidding

3 Answers 207 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sowjanya
Top achievements
Rank 1
sowjanya asked on 29 Jan 2009, 04:16 AM
Hi
  This is sowjanya.
   I m working on radgrid.
   I need to get the radgrid columns hidden or shown when i check or uncheck the checkboxes outside of the grid.
  I used hidecolumn and show column javascript functions.but it didnt work.I took checkboxes for each column outside the grid.I am hiding the column by using index values
  can anyone pls help me

thanks & regards,
sowjanya.

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 29 Jan 2009, 11:17 AM
Hello Sowjanya,

Please find my sample project attached to this post.

I hope this helps.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Princy
Top achievements
Rank 2
answered on 29 Jan 2009, 01:06 PM
Hello Sowjanya,

I'm not sure of what you require but the following client-side code worked for me to hide/show a particular column on clicking a checkbox, which you can compare for differences with the one you implemented:
aspx:
<asp:CheckBox ID="CheckBox1" runat="server" Text="PlaceFrom" onclick="hidecolumn()"  /> 

js:
 function hidecolumn() 
    {     
       var checkbox = document.getElementById("<%= CheckBox1.ClientID %>");        
       var grid = $find("<%=RadGrid1.ClientID %>"); 
       var MasterTable = grid.get_masterTableView(); 
       if(checkbox.checked == true) 
       { 
        MasterTable.hideColumn(0); 
       } 
       else if(checkbox.checked == false) 
       { 
        MasterTable.showColumn(0); 
       } 
    } 

Thanks
Princy.
0
Josh
Top achievements
Rank 1
answered on 29 Apr 2009, 07:26 AM
Hi,

    I too have the same scenario. I have executed the website attached. It was successfully executed but not working. I have cheked one of the columns and tried, but no avail. Is that i have to do any thing to add ?

Additional info :
   Version of telerik : Q3 2008.
   Version of VS      : Vs 2008 sp1 : Framework : 3.5 sp1
Tags
Grid
Asked by
sowjanya
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Princy
Top achievements
Rank 2
Josh
Top achievements
Rank 1
Share this question
or