Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
435
Problem with DrillDown
posted

I have a dataset I am binding to that has it's rows and columns swapped and is making a stacked column chart.  When double clicking, I am trying to find the level the chart is at to determine datasource to call.

For example,

Table1

ID    Level   Name  Value1  Value2  Value3

1        0        Test1        1             2             3

2        0        Test2        4             5             6

3        0        Test3        7             8             9

Table 2

ID    Level   Name  Value1  Value2  Value3

4        1        Test4        1             2             3

5        1        Test5        4             5             6

6        1        Test6        7             8             9

Table 3

ID    Level   Name  Value1  Value2  Value3

7        2        Test7        1             2             3

8        2        Test8        4             5             6

9        2        Test9        7             8             9

 

So, When i set up the chart, i bind to table1.  I show three columns of Value1, Value2 and Value3 with each Name being a section on the stack.  I tell the chart to exclude the ID and Level columns.  When i double click on a datapoint, I try to determine the level. In my ChartDataClicked event handler, i use the following code:

        DataTable source = (DataTable)((UltraChart)(sender)).DataSource;
        switch ((int)source.Rows[e.DataColumn]["Level"])

I use e.DataColumn since the Columns and Rows have been switched.  The problem is, the datatable that is returning from sender.DataSource is always the parent datatable.  Not the one bound to in the drilldown.  How do i get the datatable i am currently showing?  The examples only show one level of drilldown, not multiple.