Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
310
How to bind XamspreadSheet in DataTemplate
posted

<Window x:Class="TestXamSpreadSheet.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ig="http://schemas.infragistics.com/xaml"
xmlns:testXamSpreadSheet="clr-namespace:TestXamSpreadSheet"
xmlns:igWPF="http://schemas.infragistics.com/xaml/wpf"
xmlns:system="clr-namespace:System;assembly=mscorlib"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
Title="MainWindow" Height="700" Width="525"
>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="400"></RowDefinition>
</Grid.RowDefinitions>
<Grid.Resources>
<DataTemplate DataType="{x:Type testXamSpreadSheet:WorkVM}">


<StackPanel Height="800" CanVerticallyScroll="True" ScrollViewer.VerticalScrollBarVisibility="Visible">
<Label Background="Red" Content="{Binding Path=ActiveWorkbook.ActiveWorksheet.Name}"></Label>
<ig:XamSpreadsheet Height="800" x:Name="xamSpreadsheet1" Workbook="{Binding Path=ActiveWorkbook}" >

</ig:XamSpreadsheet>
</StackPanel>
</DataTemplate></Grid.Resources>
<ContentPresenter Content="{Binding WorkVm}" VerticalAlignment="Stretch" Height="800" ></ContentPresenter>
<ig:XamSpreadsheet Grid.Row="1" x:Name="xamSpreadsheet2" Workbook="{Binding WorkVm.ActiveWorkbook}"/>
<!--<Label Grid.Row="1" Content="{Binding Header}"></Label> Style="{StaticResource test1}"-->
</Grid>

</Window>

Can you please help, i.e. whenever I try to bind the Workbook property inside the dataTemplate. XamSpreadSheet doesn't get loaded with the required spreadsheet. A spreadsheet opens-up but without any data. In above code - xamSpreadsheet1 is the one which is not getting loaded with proper data.

Whereas, xamSpreadsheet2 does get load without any issues. Only difference is that one is inside the DataTemplate and other is not.

Please let me know how we can bind the workbook properties inside the DataTemplate for the Xam Spreadsheet.

Thanks
S. 

Parents
No Data
Reply
  • 3520
    Offline posted

    Hello Sherry,

     

    Thank you for your email. I have logged this behavior in our internal tracking system with a Development ID of 202253. The next step will be for a developer to review my investigation and confirm my findings or to offer a fix or other resolution.  I will leave this case open and update you with this information after the review.  You can also continue to send updates to this case at any time.

     

    You can view the status of all development issues connected to this case from the "Development Issues" tab, when viewing this case on the "Account\Support Activity" page of our website.

Children
No Data