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

Radgrid count into ItemCommand

1 Answer 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dhamodharan
Top achievements
Rank 1
Dhamodharan asked on 20 Dec 2010, 11:29 AM
Hi,

I have radgrid. which have 170 record. but i have using paging and 15 record per page. when i give code into itemCommand

Radgrid1.items.Count =15 . how to get total count for this grid.

Thanks,
Dhamu.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 20 Dec 2010, 12:44 PM
Hello Dhamu,

Please give a try with the following code.

C#:
protected void grdEmail_ItemEvent(object sender, GridItemEventArgs e)
   {
       if (e.EventInfo is GridInitializePagerItem)
       {
           int rowCount = (e.EventInfo as GridInitializePagerItem).PagingManager.DataSourceCount;
       }
   }


Another approach is temporarily disabling the paging and then retrieve the total count using the Items.Count. After that enable the paging and set the desired page size.

Thanks,
Princy.
Tags
Grid
Asked by
Dhamodharan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or