Home Forums WPF controls Xceed DataGrid for WPF How to improve Datagrid performance?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26926 |

    Hi,
    I have some 160000 datas(Rows) to bind. I’m using the follwing method

    List<string[]> dataToBind=new List<string[]>()
           .
           .
           .
     Binding dataBind = new Binding();
     dataBind.Source = dataToBind;
     dataBind.Mode = BindingMode.TwoWay;
     dataBind.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
     this.theGrid.SetBinding(DataGridControl.ItemsSourceProperty, dataBind);
     
     In the above method i keep all my data in memory. So my performance getting slow also CPU usage high.
     
     Instesd of binding 160000 records in a single attempt i like to bind only visible record(about 100 records).
     On demand i’ll bind other records.
     
    Here my question is
    1.If i bind the second 100 record the Data grid takes time to display.
      Is it possible to bind data with out any delay in the UI(Like Scrolling in DataGrid)?

    2.And Normally The bounded value changes means the UI also getting reflected.
      But in this case If i Change the bounded value like this

      List<string[]> data1=new List<string[]>();
            .
            .
            .
      dataToBind=data1;

    The UI(DataGrid) not reflected  the change in value. Is there any other way available?

    Imported from legacy forums. Posted by Anand (had 1469 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi

    Can anybody give me the solution for above problem. If u can’t understand please tell me.. 

    Imported from legacy forums. Posted by Anand (had 1015 views)

    Xceed Support
    Member
    Post count: 5658

    Hi,

    1) No. The delay is required to generate and display the first page of data. Please note that we are currently working on performance improvements (see roadmap for details).

    2) The binding does not update because you are not setup properly. Typically, bindings are used between Properties that implement change notification. In your case, the binding is using a Source that never changes (therefore, no updates).

    Imported from legacy forums. Posted by Marcus [Xceed] (had 497 views)

    User (Old forums)
    Member
    Post count: 23064

    Ok.If i try the following means

    List<string[]> dataToBind=new List<string[]>()

    public List<string[]> DataToBind
    {
        set
        {
            dataToBind=value;
        }
        get
        {
            return dataToBind
        }

    Is it enough to bind the property DataToBind  to the datagrid(For my second question)?

    or weather i need to create INotifyPropertyChanged?

     

    Imported from legacy forums. Posted by Anand (had 563 views)

    Xceed Support
    Member
    Post count: 5658

    You will need to implement INotifyPropertyChanged for change notification to kick in (that or use a DependencyProperty instead of a CLR property).

    Imported from legacy forums. Posted by Marcus [Xceed] (had 467 views)

    User (Old forums)
    Member
    Post count: 23064

    If i use INotifyPropertyChange means it will take time for bring data in to view. so what can i do for update data for with out disturb view like data grid scroll?

    Imported from legacy forums. Posted by Anand (had 619 views)

    Xceed Support
    Member
    Post count: 5658

    Hi Anand,

    If you change the data source, it is quite normal that the grid scrolls since it is being reset. This is the normal and expected behavior.

    If you want to preserve the scroll, you could try preserving the index of the CurrentItem and then reaffecting the CurrentItem to the new data item located at the old index.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 1216 views)

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.