www.nuneworld.net

July 4, 2012

Asp.net pagging not visible when user e.Row.Cells[0].Visible C#

Filed under: Software — Tags: , , , — admin @ 12:01 pm

If you use: e.Row.Cells[0].Visible = false pegging of grid is not visible.

Solution:

e.Row.Cells[0].Visible = false;

In a gridview there are different types of rows i.e. Header,Footer,Pager, Separator and so on. If I set the visibility of first cell as hidden then all the information for that row will be hidden irrespective of the row type. Page numbers in gridview are placed on pager row type, so from the above code row of type pager becomes hidden.

To fix the issue we can change the above code as

if (e.Row.RowType != DataControlRowType.Pager)
e.Row.Cells[0].Visible = false;

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress