Hello All,
I have a report which show data hierarchical data with three levels of grid.
I have used the nested view template for this.
Also, i have a selection on the top of the page, which allows the user to select the no of nested grids.
So, i need to hide the expand/collapse column based on the selection made.
Let me know, how should i approach to this.
Thanks,
Avi
7 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 09 Apr 2010, 01:49 PM
Hello Avi,
Try the following code in order to hide the Expand/Collapse column in hierarchy.
C#:
Regards,
Princy.
Try the following code in order to hide the Expand/Collapse column in hierarchy.
C#:
| protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e) |
| { |
| if (e.Column.UniqueName == "ExpandColumn") |
| { |
| e.Column.Visible = false; |
| } |
| } |
Regards,
Princy.
0
Ed McCarroll
Top achievements
Rank 1
answered on 15 Jun 2010, 07:40 PM
There are a number of similar posts, all trying to hide the expand/collapse column under one circumstance or another.
Has anybody come up with a solution for this yet? I'm using Q1 2010 Asp.Net AJAX, .Net 3.5, with the Web20 skin, and I simply want the expand/contract column to disappear.
Has anybody come up with a solution for this yet? I'm using Q1 2010 Asp.Net AJAX, .Net 3.5, with the Web20 skin, and I simply want the expand/contract column to disappear.
0
Princy
Top achievements
Rank 2
answered on 16 Jun 2010, 06:56 AM
Hello Ed McCarroll,
You can also try any of following approaches to hide the Expand/Collapse column.
1: Add the following CSS in your page.
CSS:
2: Try the following code in PreRender event.
C#:
Thanks,
Princy.
You can also try any of following approaches to hide the Expand/Collapse column.
1: Add the following CSS in your page.
CSS:
| <style type="text/css"> |
| .rgExpandCol |
| { |
| display:none !important; |
| } |
| </style> |
2: Try the following code in PreRender event.
C#:
| protected void RadGrid1_PreRender(object sender, EventArgs e) |
| { |
| RadGrid1.MasterTableView.ExpandCollapseColumn.Display = false; |
| } |
Thanks,
Princy.
0
Ed McCarroll
Top achievements
Rank 1
answered on 16 Jun 2010, 01:49 PM
Thanks, Princy, the CSS did the trick.
OTOH, using ExpandCollapseColumn.Display in the code-behind caused the same kind of header mismatch discussed in other posts.
But problem solved, and "You da man!"
OTOH, using ExpandCollapseColumn.Display in the code-behind caused the same kind of header mismatch discussed in other posts.
But problem solved, and "You da man!"
0
Cameron Stitt
Top achievements
Rank 1
answered on 06 Jul 2010, 01:40 AM
I just worked out another way to do this without css for those that are interested.
| protected void RadGrid1_PreRender(object sender, EventArgs e) |
| { |
| RadGrid1.MasterTableView.ExpandCollapseColumn.Display = false; |
| if(!Page.IsPostBack) |
| { |
| foreach (Telerik.Web.UI.GridDataItem item in RadGrid1.MasterTableView.Items) |
| { |
| item.Expanded = true; |
| item.ChildItem.Cells[0].Visible = false; |
| } |
| } |
| } |
0
Chanan Zass
Top achievements
Rank 1
answered on 12 Aug 2010, 03:12 PM
We have a 4-level hierarchical RadGrid and would like to show or hide the expand/collapse column in certain levels.
while the following works (expand/collapse column is hidden on all levels)
this does not:
In other words, we can't seem to be able to control the expand/collapse column in DetailTables programmatically (the above code is included in the Page_Load method.
I should say that these other calls work with no problem:
Any idea why?
while the following works (expand/collapse column is hidden on all levels)
RadGrid1.MasterTableView.ExpandCollapseColumn.Visible = Falsethis does not:
RadGrid1.MasterTableView.DetailTables(0).ExpandCollapseColumn.Visible = FalseIn other words, we can't seem to be able to control the expand/collapse column in DetailTables programmatically (the above code is included in the Page_Load method.
I should say that these other calls work with no problem:
RadGrid1.MasterTableView.DetailTables(0).Name = "Buyers" RadGrid1.MasterTableView.DetailTables(0).CommandItemSettings.ShowAddNewRecordButton = False RadGrid1.MasterTableView.DetailTables(0).DetailTables(0).Visible = FalseAny idea why?
0
Oleg
Top achievements
Rank 1
answered on 28 Sep 2012, 02:13 PM
RadGrid1.MasterTableView.ExpandCollapseColumn.Visible = Falsework fine, thanks!