Question
Ascension Health
US
Last activity: 18 May 2018 10:03 EDT
WPF DATAGrid
Error. DataTable is a get property. Is there any other ways of passing the items of type (DataTable) to an interrogated WPF datagrid.
***Updated by moderator: Lochan to add Categories***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Ascension Health
US
Missing Image
Pegasystems Inc.
US
Marshalling complex objects across to a translator object in the interrogated process is not supported. If you want to update a single cell value use the grid's SetCellValue method.
The other option would be to modify the grid's DataSource directly. However, DataSource could be one of any number of types. You'd need to discern its actual type before proceeding. For instance, if the DataSource was a DataTable you could probably do something like.
var table = this.NativeControl.DataSource;
var row = table.NewRow();
row["id"] = i; row["item"] = "item " + i.ToString(); table.Rows.Add(row);
Ascension Health
US
Thanks for your respond. I got an exception
An exception of type 'System.MissingMemberException' occurred in OpenSpan.IPC.dll but was not handled in user code
Additional information: Unable to find Property named 'DataSource' on class: 'System.Windows.Controls.DataGrid.
Also for the single value insertion, I still got an error.
Pegasystems Inc.
US
According to the exception there's nothing in the ItemCollection. Have you passed anything into that collection?
-
Sourav Debnath
Pegasystems Inc.
US
I'm confident this issue can be resolved with an Extension, but it will require some exploration of the control itself. Please open an SR with Support and we can help you work through the issue.
Regards
Pegasystems Inc.
IN
Hi @KingsleyE,
Please let us know the SR number once created. We will continue to track it through this post.
Regards,
Ascension Health
US
Hi,
Thanks for your effort. I and my team mate where able to find a way around.
We noticed that Pega only communicate well with wpf textboxes but fails when we try to pass message into wpf textblocks and labels.
We decided to use textbox in place of our label.
The trick was, we won't let Pega fetch the data but pass the sql connection string and command string to the interrogated hidden textboxes in the wpf application and perform a click event on a hidden button confirming that the textboxes have being filled with the sql statement required for fetching the data.
Once that is done, A method inside the WPF UI is triggered to fetch the data itself and bind it to it datagrid.