This is a migrated thread and some comments may be shown as answers.

Problem using DataView as ItemsSource

4 Answers 101 Views
Chart
This is a migrated thread and some comments may be shown as answers.
San
Top achievements
Rank 1
San asked on 20 Aug 2009, 05:53 AM
Hi all,

when using DataView as ItemsSource for my chart I faced performance problem or my WPF application finally does no longer response.

I take a DataView to filter the underlying DataTable data as following:

MyChart.ItemsSource = null;
DataView view = new DataView (MyDataTable);
view.RowFilter = "SUPPLIER LIKE 'MC21*";
MyChart.ItemsSource = view;

When comming the the last assigning statement of ItemsSource my application doesn't response.
This happens especially, when using the SUPPLIER Column as the XCategory of the chart.

Do you have any idea?

Thanks,
San

4 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 21 Aug 2009, 10:57 AM
Hello San,

I have tested this scenario and everything works fine. We need further details on your use case to be able to effectively analyze the scenario and provide further assistance.

Best,
Evtim
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
San
Top achievements
Rank 1
answered on 23 Aug 2009, 11:19 AM
Hi Telerik Team,

1.) after a few research I could figure out the cause for the problem.
It seems that the root cause was the dataentries in my datatable, where I used randomed data entries:
            dataTable = new DataTable();
            DataColumn col = new DataColumn("MName");
            col.DataType = typeof(string);
            dataTable.Columns.Add(col);
            col = new DataColumn("PCost");
            col.DataType = typeof(double);
            dataTable.Columns.Add(col);
            col = new DataColumn("CCost");
            col.DataType = typeof(double);
            dataTable.Columns.Add(col);
            col = new DataColumn("MCosts");
            col.DataType = typeof(double);
            dataTable.Columns.Add(col);          

            Random rdn = new Random();
            dataTable.Rows.Add(new object[] { "1/2009", rdn.Next(2000), rdn.Next(2000), rdn.Next(2000) });
            dataTable.Rows.Add(new object[] { "2/2009", rdn.Next(2000), rdn.Next(2000), rdn.Next(2000) });
   
           Sometimes the filter works for the first try. But after the second or third filter try, I do face the issue.       

2. )When doing the same with static values such as
            dataTable.Rows.Add(new object[] { "1/2009", 100, 300, 200 });
            dataTable.Rows.Add(new object[] { "2/2009", 200, 250, 200 });
the dataview filter on the datatable does work properly, and I could assign the dataview result to the ItemsSource of my Chart.

I used filtering such as "MName Like '1*', "PCost > 1500", "CCost < 270"

Do you have an idea why this happens or what I did wrong?

3.) I do face the same problem when retrieving real data from my database into a dataSet object and trying to filter the result via DataView.

Would be great if you could advice,
Regards,
San
0
Accepted
Dwight
Telerik team
answered on 25 Aug 2009, 01:42 PM
Hello San,

Unfortunately, we cannot reproduce the issue. Can you, please, send a simple working project that we can debug locally?
Thanks in advance.

Best,
Evtim
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
San
Top achievements
Rank 1
answered on 05 Sep 2009, 04:53 PM
I have reinstalled my PC. Now, it works fine. Seems to be a local issue on my PC... sorry for any inconveniences.
San
Tags
Chart
Asked by
San
Top achievements
Rank 1
Answers by
Dwight
Telerik team
San
Top achievements
Rank 1
Share this question
or