According to the GraphQL specification, it is "a query language designed to build client applications by providing an intuitive and flexible syntax and system for describing their data requirements and interactions". Starting with version 25, connecting List & Label with a GraphQL API as data source is as simple as creating a new List & Label GraphQLDataProvider object and passing your API address as URL constructor parameter.
GraphQLDataProvider prov = new GraphQLDataProvider("https://localhost:44375/api/graphql");
If your GraphQL data source is to support images, you can serialize and transfer them using GraphQL via Base64 string encoding. To decode these fields back to Bitmap for ListLabel, you can use ListLabel AutoDefineField event. the following code shows how to do it in a Northwind sample:
LL.AutoDefineField += new AutoDefineElementHandler(LL_AutoDefineField); void LL_AutoDefineField(object sender, AutoDefineElementEventArgs e) { string name = e.Name.ToString(); string value = e.Value.ToString(); if (name == "Q_categories.picture") { ListLabel ll = sender as ListLabel; e.Suppress = true; if (value.Length > 50 && value.Length % 4 == 0) { ll.Fields.Add(e.Name, Convert.FromBase64String(value)); } else { ll.Fields.Add(e.Name, string.Empty, LlFieldType.Drawing_hBitmap); } } }
Free List & Label trial for 30 days.
Jochen Bartlau leads the development at combit as Managing Director. He's a Microsoft .NET enthusiast driving innovation & agile project management. The mobile devices geek who used to be a physicist in his first life loves to spend his spare time with his family.