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

Radgrid NestedViewTemplate and columns

1 Answer 181 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
Sophie
Top achievements
Rank 1
Sophie asked on 14 Jun 2016, 11:33 AM
Hi,
I am new in Sitefinity and ASP.NET technologies... 
I have 2 issues that I am trying to resolve:
I have a radgrid with 5 columns.
1. The last column of my grid is a GridColumnGroup containing 3 sub-columns corresponding to 3 actions. I would like to display the header for this GridColumnGroup but not displaying the headers for these 3 sub-columns (for now the 3 sub-columns have an empty header each but I would not want to see at all these headers space (removing the header spaces and not having this row for the 3 sub-columns headers).. Is it possible?

2. My second issue is to elaborate a NestedViewTemplate as here:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/hierarchical-grid-types-and-load-modes/nestedview-template
I first tried to display (in C#) at least a simple text linked to the first row as follow but this is not working. I am a little bit lost with how to do that programmatically?
ApplicationsGrid.MasterTableView.Items[0].ChildItem.NestedTableViews[0].DataSource = "test expand";
ApplicationsGrid.MasterTableView.Rebind();
Thank you for your help.
Best

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 17 Jun 2016, 09:29 AM
Hi Sophie,

Straight to the points:

1. You can access the header item during the PreRender event handler of the grid and traverse and hide the mentioned TableCells by using their Visible="false" or .Style["display"]="none" property. However, please note that this requirement is not tested and may prove error-prone.

2. You will need to pass a valid DataSourceID to the inner grid as demonstrated in the following live sample:
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/hierarchy-with-templates/defaultcs.aspx

Alternatively, you can use programmatic databinding with the DataSource property, similar to attached web site sample.

I hope this will prove helpful.

Regards,
Eyup
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Sharepoint Integration
Asked by
Sophie
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or