Please note: In an effort to better serve you, we are in the process of restructuring DevCenter.
In the process, we have moved many items that you may be used to finding in DevCenter over to the
Main Site. If you are having trouble locating something,
please try looking at the following places:
Code: Getting the Data VB.NET
For this particular sample, the code and logic for data access is within the user interface. In a real-world enterprise application, this will be handled by the Data Access Layer and / or business objects that reside in the Business Logic Layer. For simplicity sake, this sample includes everything within the user interface. As you can see here, this method accepts a SqlCommand that was built in the BuildChart method and it returns a DataTable that contains the schema and data for a particular drill level. Code: Initiating the Drill Down through the UI VB.NET
The end user initiates the drill down by simply clicking on any Data element within the Chart. When the form first loads, the user clicks on a bar, which represents one customer. The Chart then drills to the next level and that represents the single Customer’s Orders. The User then clicks on one Order represented by another Chart Bar. This causes us to drill down to the next level which is now a Chart that is populated with the particular Order’s Line Items and thus ends the drilling because this is the maximum drill level. The Chart click interaction is handled by the “ChartDataClicked” event. In this event, we have enough information to allow us to drill to the next level. The event arguments in this event provide much useful information. We are only using the Row Label in this case. The Row Label represents the one string value in a particular row in which the resulting data is grouped by. For example, if we submit a SQL query that selects a person’s First Name and then a count of sales and we group by the First Name, the resulting data would contain a list of First Names along with a numeric that represents the sales for each person. The actual First Name value of each row would be considered the “Row Label” in chart terms. We use this Row Label to build another query such as “get me the orders that belong to customer ALFKI”..Continued..