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

Dynamic codebehind ColumnGroups and Excel Export

7 Answers 272 Views
GridView
This is a migrated thread and some comments may be shown as answers.
tony
Top achievements
Rank 1
tony asked on 02 Dec 2011, 09:04 PM
Hi,

I just got the newest version and was pleased to see the addition of merged column headers. However, We currently generate our ColumnGroups after a service call and while the columns show up properly, the groupColumn always shows up blank.

public MainPage()
 {
 InitializeComponent();
 
 service.ServiceClient sc = newService.ServiceClient();
 sc.SaveFileCompleted += new EventHandler<service.SaveFileCompletedEventArgs>(sc_SaveFileCompleted);
 sc.SaveFileAsync();
}
 
void sc_SaveFileCompleted(object sender, fileSaveService.SaveFileCompletedEventArgs e)
{
 RadGridView.ColumnGroups.Add(new Telerik.Windows.Controls.GridViewColumnGroup() { Name = "Vehicle_Info", Header = "Vehicle info" });
 RadGridView.ColumnGroups.Add(new Telerik.Windows.Controls.GridViewColumnGroup() { Name = "Dimensions", Header = "Dimensions" });
 
//Further Column Definition
 
}

This will draw the columns properly, but will fail to render the columnGroups.

I have attached a screenshot of what gets rendered.

Secondly, we are trying to export from the grid with merged column headers and it doesnt seem to render the merged columns, I was wondering how we can get the merged columns as part of our excel export?

Thanks!
Tony

7 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 08 Dec 2011, 01:57 PM
Hi Tony,

Thank you for the feedback ! I am treating these as feature requests . Both are reasonable - adding groups runtime should result in properly rendered column groups  and column groups should be included when exporting data.

We have a service pack release planned within two weeks. I will do my best to have the improvements for you included.

One more time thanks for the valuable feedback. I am updating your Telerik points.

All the best,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
AdrianP
Top achievements
Rank 2
answered on 06 Feb 2012, 10:29 AM

Hello Pavel,

Has this feature been added? I also have the same problem, and I use the latest build: 2011.3.1220.1050.

Thank you,
Adrian



0
Pavel Pavlov
Telerik team
answered on 06 Feb 2012, 11:20 AM
Hi Adrian ,

Please download our latest internal build and give it a try . In case you still experience any troubles please let me know.

Greetings,
Pavel Pavlov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Frodi
Top achievements
Rank 1
answered on 15 Feb 2012, 02:04 PM
Hello Pavel

The merged column headers does not yet export. Is it possible to get an estimated time of when we can expect this feature. 

I am using the newest internal build at this moment: RadControls_for_Silverlight4_2011_3_1413.

Thank you
0
Pavel Pavlov
Telerik team
answered on 15 Feb 2012, 03:46 PM
Hello Frodi,

In a few hours you should be able to download our new official release (Q1 2012) which does include the feature promised earlier.

All the best,
Pavel Pavlov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Arun
Top achievements
Rank 1
answered on 18 Nov 2014, 06:20 PM
Hi,

I have a scenario where i need to create GridViewColumnGroup dynamically from my Viewmodel. I have few fields to be displayed in the header like
'Report Name':testReport
'Total amount Collected':10000
and etc.
Report Name and Total amount Collected values will be bound to the group header only at the run time. How can i achieve this scenario ? Can anyone help with this ?

0
Nick
Telerik team
answered on 19 Nov 2014, 08:55 AM
Hi Arun,

I am not exactly sure what your requirements are. However all of the Properties available in XAML are available in the code behind too. You can add and remove Column Groups through the ColumnGroups Collection in RadGrdiView. 

Hope this helps. 

Regards,
Nick
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
tony
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
AdrianP
Top achievements
Rank 2
Frodi
Top achievements
Rank 1
Arun
Top achievements
Rank 1
Nick
Telerik team
Share this question
or