I have two for loops from which I am displaying the folder items in a table.
i.e. from outer for loop I am displaying the folder names and from inner loop
I am displaying the contents of that folders .
Now I want to do paging since in case of hundreds and thousands of msgs in my inbox.
So I think datagrid is the best option for tht
but I am getting how to populate the datagrid according to this and do paging in tht.

Your best option is to use a TreeView or ListView if your dealing with Folders and Files. A Datagrid is best used to interface a database like MS SQL or Access.