Exchanging data with add-ins
In this chapter, we learned how to create custom visual controls, call add-in methods from NAV application code, and raise and handle control events. Almost all recipes so far covered controls that accept scalar values in parameter methods. This is good for extensions displaying a single value, but if you need to show a table control, sending values for each table cell one by one is not the best way to fill the dataset. Recipes dedicated to JavaScript controls, explain one possible solution for this problem - sending data to the control as a JSON string. JSON format is native to a JavaScript environment. In .NET controls, wrapping data in a DataTable object is a more common approach.
How to do it...
This recipe shows how to create a custom DataGridView
control that shows a list of customers in a table. To populate the control with data, we will employ the DataTable .NET object.
Start a new C# project in Visual Studio based on the Class Library template. In the New...