Welcome to the Xceed Community | Help
Community Search  
More Search Options

Binding to dataset

Sort Posts: Previous Next
  •  09-02-2008, 5:24 AM Post no. 14741

    Binding to dataset

    I.m using the Xceed datagrid v.2 for WPF, the free one.

    When I bind to the grid using:

    grdExceed.ItemsSource = ds.Tables[TableName].DefaultView

    with a dataset containing around 1000 rows it takes about 3 minutes for it to display.

    Is it supposed to be that slow or what??? 

     

    Filed under: ,
  •  09-02-2008, 9:35 AM Post no. 14759 in reply to 14741

    Re: Binding to dataset

    By default, a grid will take all the room that it requires; therefore, if it is not given a size constraint, such as when it is placed in a StackPanel, and a large amount of data items are present, UI virtualization will be lost—resulting in a significant loss in performance. To preserve UI virtualization when a grid is in a StackPanel, the MaxWidth and MaxHeight properties (or Width and Height) must be used to constrain the grid. As an alternative, a DockPanel or Grid can be used as both impose size constraints on their child elements.
    Senior Technical Writer
    - Xceed Software

    In three words I can sum up everything I've learned about life: it goes on.
  •  09-03-2008, 3:26 AM Post no. 14821 in reply to 14759

    Re: Binding to dataset

    Awesome!! Thanks Jenny for the quick response. Works like a charm now.

    /Johan Z 

  •  11-15-2010, 3:09 AM Post no. 29231 in reply to 14759

    Re: Binding to dataset

    Hi Jenny,

    I am facing a problem with binding a datatable to xceed datagrid. Based on the search criteria my datatable changes. When I bind the grid to a datatable it is showing all columns as expected. But when I bind to the grid for the second time to a datatable which will have enterily different columns, grid is adding them to the existing columns instead of removing the old one and adding new ones.

    Could you please let me know how can i solve this problem

     

    Thanks,

    Shiva

  •  11-15-2010, 6:58 AM Post no. 29234 in reply to 29231

    Re: Binding to dataset

    Sounds like you are replacing the DataSet in your dataGridCollectionView but not clearing the previous column definitions.

    I would suggest that you try the following:

    dgcv.ItemProperties.Clear();  (where dgcv is the existing dataGridCollectionView that you use to wrap your DataSet)

    or

    dg.Columns.Clear();   (where dg is your Xceed DataGrid object)

     I know that I do both, but not clear if one or both is required.

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.