Passing DataTable into a UiPath WPF Form Creator activity

Viewed 421

I am using this nuget UiPathTeam.WpfFormCreator.Activities, through which we could show a xaml form for user input by an attended robot. I managed to correctly work through types (Text,Image,Date,...) to populate controls like TextBoxes, DatePicker, etc following the below link https://github.com/RaduPantelimon/UiPathActivities/blob/master/WpfFormCreator/XamlFormCreator.docx .Now I also need to populate a DataGrid passing a DataTable.I have done this much, but Stuck on the point where we specify the type for the DataTable. For String it is "Text", DateTime it is "Value".So far I have tried (DataTable,List,Array..) But I am getting the below error.

Screenshot of the error:

enter image description here

This is my xaml

<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"                             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"   
  Margin="10" Width="1000" Height="1500" >                                      
    <DataGrid  Name="Table" ItemsSource="{Binding}" AutoGenerateColumns="True" />   

    <Button Grid.Row="4" Grid.Column="1" Margin="5" HorizontalAlignment="Center" Name="submitButton" Width="100" Height="30" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">Submit</Button>
</Grid>

This is my Return Dictionary

New Dictionary( Of String, Dictionary( Of String, Object))  From { 
{ "Table", New Dictionary( Of String, Object) From { { "DataTable",InvoiceDT 
} } }}
1 Answers

Try "DataContext" as the type for passing DataTable

New Dictionary( Of String, Dictionary( Of String, Object))  From { 
{ "Table", New Dictionary( Of String, Object) From { { "DataContext", InvoiceDT } } }}
Related