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

RadGridView export for nested ItemsControl

1 Answer 56 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Aviv
Top achievements
Rank 1
Aviv asked on 29 Oct 2013, 12:16 PM
Hello,

Using Telerik version 2013.2.611.40, i'm trying to export a (grouped) grid which contains only 1 column, that has a nested items control in a GridViewDataColumn.CellTemplate. The result (ExcelML) file doesn't contain the values from the nested list.

The result (in GUI) is just what i want (and need) the problem is with the export.

* I need to be able to export to ExcelML and to display (in GUI) the data grouped like this:
^Name
some key some value
some key2 some value2
^Name2
some key3 some value3
some key4 some value4
* the 'Items' (and SourceAttributes) is an ObservableCollection of my custom view model

(part) of the xaml:
<UserControl...
<xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
...>
<DataTemplate x:Key="sourceAttributesDataTemplate">
<ItemsControl ItemsSource="{Binding Path=SourceAttributes}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".3*"/>
<ColumnDefinition Width=".7*"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Content="{Binding Path=Key}"/>
<Label Grid.Column="1" Content="{Binding Path=Value}"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<telerik:RadGridView ItemsSource="{Binding Path=Items}" AutoGenerateColumns="False" GroupRenderMode="Flat" AutoExpandGroups="False" ShowColumnHeaders="False">
<telerik:RadGridView.GroupDescriptors>
<data:GroupDescriptor Member="Name" SortDirection="Ascending" />
</telerik:RadGridView.GroupDescriptors>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Width="*" Header="" CellTemplate="{StaticResource sourceAttributesDataTemplate}">
</telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>

Is there any way to achieve this functionality? (where is the problem?)
I know that 'DataMemberBinding' is crucial - but in this case they are nested inside the ItemsControl....

Thanks in advance,
Aviv

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 29 Oct 2013, 05:54 PM
Hello Aviv,

I would suggest you to check this troubleshooting article, which demonstrates how to export custom CellTemplate.

Regards,
Yoan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Aviv
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or