Datagridview data binding issue while cell value has {}

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
ivan.liao@live.com
Posts: 2
Joined: Sat Mar 09, 2019 4:47 am

Datagridview data binding issue while cell value has {}

Post by ivan.liao@live.com » Thu Sep 05, 2019 5:12 pm

Hi Everyone,

I recently has a project need to show some data query from SQL server and display them with a Datagirdview.
Most of query results are pretty well done by data binding for DGV.
But it will got error if data table object has some data with {}. Seems DGV cannot display a cell with value like {some text here}.

How can I get this done?
Thanks in advance!

jvierra
Posts: 13901
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Datagridview data binding issue while cell value has {}

Post by jvierra » Thu Sep 05, 2019 5:39 pm

What is the field type. It appears that the field is an array type and must be converted for display in a DGV.

ivan.liao@live.com
Posts: 2
Joined: Sat Mar 09, 2019 4:47 am

Re: Datagridview data binding issue while cell value has {}

Post by ivan.liao@live.com » Thu Sep 19, 2019 6:52 pm

Thanks for your remind. I just checked this column data type is System.Byte[], do you know how can I display this type of data in DGV correctly?

Thanks!
jvierra wrote:
Thu Sep 05, 2019 5:39 pm
What is the field type. It appears that the field is an array type and must be converted for display in a DGV.

jvierra
Posts: 13901
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Datagridview data binding issue while cell value has {}

Post by jvierra » Thu Sep 19, 2019 7:12 pm

You have to covert it into something useful. A byte array is not useful to anyone when displayed.

Locked