![]() Var jsonDataSource = new JsonDataSource() Private JsonDataSource CreateDataSourceFromWeb() GridControl1.DataSource = CreateDataSourceFromWeb() Private void Form1_Load(object sender, EventArgs e) To bind to JSON-formatted data in code, create a new object. Select it and click “Next” to proceed.Ĭhoose whether or not you want to utilize the component, and select which elements selected in step 5 you want to pass to a data-aware control. Rebuild your solution and open the Data Source Configuration Wizard again - you will now see an available source in the “JSON Data Source” tab. The “Select Root Element” page allows you to choose the data sets to which you wish to bind. If you have selected the Web Service Endpoint (URI) option, enter login credentials and optional HTTP Headers/Query Parameters.Ī JSON data source may have multiple data sets, all owned by the topmost “root” element. You can supply a real data source or use a test data set available online (for example, on GitHub). JSON String - Select this option to paste JSON data in raw text form.JSON File - Choose this type if you have a JSON data file on local storage.Web Service Endpoint (URI) - Select this option if you have the URI of the JSON file stored on the web.In the Data Source Editor dialog, select the required JSON data source type: This will automatically add a new component to the form and invoke its Data Source Editor dialog. Invoke the Data Source Configuration Wizard for the data-aware control you need to bind.Ĭhoose the “JSON Data Source” option and click “New Data Source…”.
0 Comments
Leave a Reply. |