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

GetContainerFromItem is not bringing all the rows

Sort Posts: Previous Next
  •  05-28-2012, 10:28 AM Post no. 32157

    GetContainerFromItem is not bringing all the rows

    Hi Experts,

         I am trying to get data row of all the items in the datagrid, but it's taking only visible item's datarow.

    For Example: If i have 100 records, so i can't see 100 records at a time, because my grid will display 10 records by default, if i want to see next 10 record, i will scroll down, so at that if clik button, below code will execute to get 100 rows details, but it's taking only 10 records details, Can any one give solution to this applicaiton 

    Xceed.Wpf.DataGrid.DataRow dataRow = new Xceed.Wpf.DataGrid.DataRow();

    foreach (object obj in this.datagrid.Items)

    {

    dataRow = datagrid.GetContainerFromItem(obj as ExportParameterData) as Xceed.Wpf.DataGrid.DataRow;

    if (dataRow == null)

    continue;

    }

  •  05-28-2012, 10:14 PM Post no. 32164 in reply to 32157

    Re: GetContainerFromItem is not bringing all the rows

    Udaya kumar,

    This will not be possible to do because the DataGridControl uses container recycling. The only DataRows that exist are the ones that you see. When a user scroll, the DataRows that are scroll out of view are recycled and placed where there are new DataRows being scrolled into view. This was done to improve the performance of the DataGrid.

    Is there a particular reason why you would need the DataRows?


    Marc

    Developer in Technical Support
    Xceed - Multi-talented components - http://xceed.com
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.