Hi,
I use the XamPivotGrid and XamPivotDataSelector in an WPF Browser Application.
When I drag and drop a field, the XamPivotGrid(or XamPivotDataSelector ) bacome black.
Please help me.
Here is my code:
[xaml]
<Page x:Class="Page1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="1366" Title="Page1" xmlns:ig="http://schemas.infragistics.com/xaml"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <ig:XamPivotGrid Name="XamPivotGrid_Result" AllowCompactLayout="True" /> <ig:Expander Grid.Column="1"> <ig:XamPivotDataSelector Name="XamPivotDataSelector_Result" /> </ig:Expander> </Grid></Page>
[xaml.vb]
Imports System.WindowsImports System.Windows.ControlsImports System.DataImports System.Data.SqlClientImports System.ReflectionImports Infragistics.OlapImports Infragistics.Olap.FlatDataClass Page1 Dim QueryTable As New DataTable With {.TableName = "QueryTable"} Public Sub New() InitializeComponent() BuildDataSource() End Sub Private Sub BuildDataSource() Dim column1 As DataColumn column1 = New DataColumn QueryTable.Columns.Add(New DataColumn("col1", GetType(String))) QueryTable.Columns.Add(New DataColumn("col2", GetType(String))) QueryTable.Columns.Add(New DataColumn("val1", GetType(Int32))) QueryTable.Columns.Add(New DataColumn("val2", GetType(Int32))) For indexA = 1 To 30 Dim row As DataRow row = QueryTable.NewRow() row("col1") = "Joe" row("col2") = "US" row("val1") = indexA row("val2") = indexA * indexA QueryTable.Rows.Add(row) Next indexA Dim typeBuilder As New DynamicTypeBuilder() With { _ .DynamicAssemblyName = "MyAssembly", _ .DynamicTypeName = QueryTable.TableName _ } Dim properties As IList(Of DynamicTypePropertyInfo) = New List(Of DynamicTypePropertyInfo)() For Each column As DataColumn In QueryTable.Columns Dim PropertyInfo As New DynamicTypePropertyInfo() With { _ .PropertyName = column.ColumnName, _ .PropertyType = column.DataType _ } properties.Add(PropertyInfo) Next Dim dynamicType As Type = typeBuilder.GenerateType(properties) Dim listType As Type = GetType(List(Of )) Dim genericListType As Type = listType.MakeGenericType(dynamicType) Dim list As IList = DirectCast(Activator.CreateInstance(genericListType), IList) For Each dataRow As DataRow In QueryTable.Rows Dim myDynamicInstance As Object = Activator.CreateInstance(dynamicType) For Each column As DataColumn In QueryTable.Columns Dim propertyVal As PropertyInfo = dynamicType.GetProperty(column.ColumnName) If IsDBNull(dataRow(column)) = False Then propertyVal.SetValue(myDynamicInstance, dataRow(column), Nothing) End If Next list.Add(myDynamicInstance) Next Dim flatDataSource As New FlatDataSource() With { .ItemsSource = list, _ .Cube = DataSourceBase.GenerateInitialCube(QueryTable.TableName), .Columns = DataSourceBase.GenerateInitialItems("[col1].[col1]"), .Rows = DataSourceBase.GenerateInitialItems("[col2].[col2]"), .Measures = DataSourceBase.GenerateInitialItems("val1") } XamPivotGrid_Result.DataSource = flatDataSource XamPivotDataSelector_Result.DataSource = flatDataSource End SubEnd Class
Is this bug in version 11.2? Because I am about to update to the version.
Thanks
Sangeetha
Hello,
Initially we haven’t supported drag-drop in xbap applications but there were number of questions exactly about that issue.
We are going to fix that in the upcoming SR for 10.3; 11.1 and 11.2.
Plamen.