Problem using DataView as ItemsSource

5 posts, 1 answers
  1. San
    San avatar
    3 posts
    Member since:
    Jul 2009

    Posted 20 Aug 2009 Link to this post

    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
  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 21 Aug 2009 Link to this post

    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.
  3. San
    San avatar
    3 posts
    Member since:
    Jul 2009

    Posted 23 Aug 2009 Link to this post

    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
  4. Answer
    Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 25 Aug 2009 Link to this post

    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.
  5. San
    San avatar
    3 posts
    Member since:
    Jul 2009

    Posted 05 Sep 2009 Link to this post

    I have reinstalled my PC. Now, it works fine. Seems to be a local issue on my PC... sorry for any inconveniences.
    San
Back to Top