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

Paging in GridView

0 Answers 30 Views
GridView
This is a migrated thread and some comments may be shown as answers.
raghul
Top achievements
Rank 1
raghul asked on 01 Mar 2012, 06:31 AM
Hi,

I have developed a grid which has paging in it, it works fine for me, but when I try to convert the QueryableCollectionView to a list it returns null value, is there a way to convert that.
Please find my coding below
            
RadDataPager objRadDataPager = new RadDataPager();
             objRadDataPager.Name = "radPager1";
             objRadDataPager.Height = 25;
             objRadDataPager.PageSize = 4;
             objRadDataPager.IsTotalItemCountFixed = true;
             objRadDataPager.DisplayMode = PagerDisplayModes.All;
             objRadDataPager.Width = double.NaN;
             objRadDataPager.BorderThickness = new Thickness(2);
             QueryableCollectionView qcv = new QueryableCollectionView(lstApuandPeopleSoft.ToList().OrderBy(x => x.StartTime).ToList());
             objRadDataPager.Source = qcv;
             grdProcessLog.ItemsSource = qcv;
             IList<ApuandPeopleSoft> objAutomationIDEItems12 = grdProcessLog.ItemsSource as List<ApuandPeopleSoft>;
             summation = 0;
             foreach (var item in objAutomationIDEItems12)
             {
                 TimeSpan tss = getTimeSpan(item.TotalTime);
                 summation += tss.TotalSeconds;
             }
             TimeSpan t = TimeSpan.FromSeconds(summation);
             txttotalhrs.Text = string.Format("{0:D2}: {1:D2}: {2:D2}",
                     t.Hours,
                     t.Minutes,
                     t.Seconds);
I get an error in
IList<ApuandPeopleSoft> objAutomationIDEItems12 = grdProcessLog.ItemsSource as List<ApuandPeopleSoft>;
because the grid source is not of type list<ApuandPeopleSoft> but of type QueryableCollectionView. but when i convert that to QueryableCollectionView I will not be able to calculate the time span because i am not able to convert that to List of AouandPeopleSoft. Can u please let me know as how this needs to be handled?

No answers yet. Maybe you can help?

Tags
GridView
Asked by
raghul
Top achievements
Rank 1
Share this question
or