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

java script for expand and collapse column

2 Answers 64 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
abinav
Top achievements
Rank 1
abinav asked on 04 Jul 2011, 10:34 AM
hi

i have added an image button to the gridbound column one to expand the column and the other to collapse and i used the following javascript to execute the above requirement
function CollapseColumn(index, element)
            {
                //var cols = <%= RadGrid1.ClientID %>.MasterTableView.Columns;
                <%= RadGrid1.ClientID %>.MasterTableView.ColGroup.Cols[index].width = "20px";   
                element.style.display = "none";
                element.nextSibling.style.display = "";
            }
  
            function ExpandColumn(index, element)
            {
                //var cols = <%= RadGrid1.ClientID %>.MasterTableView.Columns;
                <%= RadGrid1.ClientID %>.MasterTableView.ColGroup.Cols[index].width = "";
                element.style.display = "none";
                element.previousSibling.style.display = "";
            }

 

but it is working when i use gridtemplate column and not for boundcolumn pl help me to fix this i want this for g ridboundcolumn

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Jul 2011, 11:39 AM
Hello Abinav,

RadGrid supports in built expand collapse columns. There is no need to explicitly handle it. Check out the following documentation for more on this.
Column types.

Thanks,
Princy.
0
abinav
Top achievements
Rank 1
answered on 04 Jul 2011, 01:10 PM
hi

i have created bound column through server side so i want to do the expand and collapse through javascript
Tags
General Discussions
Asked by
abinav
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
abinav
Top achievements
Rank 1
Share this question
or