Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display json data in datagrid #2715

Closed
632575987 opened this issue Dec 20, 2018 · 4 comments
Closed

Display json data in datagrid #2715

632575987 opened this issue Dec 20, 2018 · 4 comments
Labels
DataGrid 🔠 Issues on DataGrid control

Comments

@632575987
Copy link

Display json data in datagrid control flexiable

since the datatable is unavilable in uwp, so usually I use json format to transfer data, I hope the datagrid control can be bind to a json datasource to generate the rows and columns automaticly. For example, I send a SQL sentance to server and receive the excute result (json formart) then display it on datagrid, I haven't found the way to do it.

Current behavior

convert the json data to a defined Class and then bind to datagrid control .

Expected behavior

bind the Jarray data to datagrid directly.

Environment

Nuget Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ x ] April 2018 Update (17134)
- [ x ] October 2018 Update (17763)
- [ x ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ x ] April 2018 Update (17134)
- [ x ] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [ x ] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ x ] 2017 (version: )
- [ ] 2017 Preview (version: )

@skendrot
Copy link
Contributor

I would not expect to be able to pass a string to the DataGrid and it shows data. Is there a reason you cannot turn the json string into an object?

@byrialsen
Copy link

Hi @632575987 .

I believe that DataTable is available in UWP, but it can't be used for DataGrid binding in xaml. Actually I have created this User vote yesterday.

Would this one solve your problem too?

@byrialsen
Copy link

byrialsen commented Dec 20, 2018

To me it sounds like what you try to do @632575987 is exactly what this example does?

https://xamlbrewer.wordpress.com/2018/05/29/displaying-dynamic-sql-results-in-a-uwp-datagrid/

@632575987
Copy link
Author

Thanks very much,I have got it by your example link ,many many thanks @byrialsen

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
DataGrid 🔠 Issues on DataGrid control
Projects
None yet
Development

No branches or pull requests

4 participants