Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 在图表控制中排序不起作用?_Asp.net_Sorting - Fatal编程技术网

Asp.net 在图表控制中排序不起作用?

Asp.net 在图表控制中排序不起作用?,asp.net,sorting,Asp.net,Sorting,我要做的是显示排序后的图表。仅显示未排序的图表。从SortDropDownList选择后,图表系列没有变化,即不排序。 我已经使用了selectedChangedEvent,虽然我没有在这里显示 任何帮助都会是很大的帮助。 谢谢您可以将AutoPostBack添加到您的dropdownlist中 finalChart.Series["Series1"].ChartType = SeriesChartType.Column; finalChart.Series["Series1"].XValueM

我要做的是显示排序后的图表。仅显示未排序的图表。从SortDropDownList选择后,图表系列没有变化,即不排序。 我已经使用了selectedChangedEvent,虽然我没有在这里显示

任何帮助都会是很大的帮助。
谢谢

您可以将AutoPostBack添加到您的dropdownlist中

finalChart.Series["Series1"].ChartType = SeriesChartType.Column;
finalChart.Series["Series1"].XValueMember = mydatasource;
finalChart.Series["Series1"].YValueMembers = mydatasource;
if (SortDropDownList.SelectedItem.Text == "Ascending")
   finalChart.DataManipulator.Sort(PointSortOrder.Ascending,  "Series1");
else
   finalChart.DataManipulator.Sort(PointSortOrder.Descending, "Series1");  

您可以将AutoPostBack添加到dropdownlist

finalChart.Series["Series1"].ChartType = SeriesChartType.Column;
finalChart.Series["Series1"].XValueMember = mydatasource;
finalChart.Series["Series1"].YValueMembers = mydatasource;
if (SortDropDownList.SelectedItem.Text == "Ascending")
   finalChart.DataManipulator.Sort(PointSortOrder.Ascending,  "Series1");
else
   finalChart.DataManipulator.Sort(PointSortOrder.Descending, "Series1");  

我发现解决我问题的办法不管用。在上面的代码中,我从数据源列名称中分配了xvaluemember和yvaluemember。对于DataManipular.Sort to训练,我尝试了点数据,即我使用了DataBindXYxvaluemember,yvaluemember。我认为所有chartcontrols排序和分组公式只适用于点数据,而不适用于数据源。

我发现解决问题的方法排序不起作用。在上面的代码中,我从数据源列名称中分配了xvaluemember和yvaluemember。对于DataManipular.Sort to训练,我尝试了点数据,即我使用了DataBindXYxvaluemember,yvaluemember。我认为所有的chartcontrols排序和分组公式只适用于点数据,而不是数据源。

我已经这样做了。我认为问题在于与之相关的数据源。我从微软的图表控件中尝试了这个例子。但是,当我将图表与数据库表关联时,它不起作用。我已经这样做了。我认为问题在于与之相关的数据源。我从微软的图表控件中尝试了这个例子。但是,当我将图表与数据库表关联时,它不起作用。