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: Drilling Back through the UIVB.NET
The end user will be able to drill back to any level simply by clicking on any of the visible Link Labels. Since when we drilled down into the chart, we populated the Link Label Text property with the value that was used to perform the query, drilling back to any previous level will not be a problem because we have the same information to requery the database. The Logic in the Link Label Click event is simple; we set the current drill level to a value that represents the Link we clicked (each link label represents a known drill level) and then we build the chart, passing in the value of the link label’s text property so that the Chart is built using the same information that was used to get to that level previously. Improvements for scalability Aside from the obvious changes that can be made to this sample regarding the separation of logic from the UI, Business Logic and Data Access, another improvement could be implemented so that rather than using the Text property of each Link Label, we could create a collection of custom objects that store the value(s) that were used to reach each particular drill level. Whenever we enter each drill level by clicking on a Link Label, we can query the objects at that index (+1 since it is a 0 based index) and then retrieve the data again. Review: Now that we have seen how simple it is to achieve Chart Drilldown, implementing your own should be a rewarding experience. Please feel free to download the included sample which includes versions in VB.NET and C#. You will need to point to an instance of SQL Server that contains the Northwind database. The connection string is currently configured to point to your local pc.[End of article]