We cannot directly get the page index value. Doing so, in Row_DataBound event, check as
e.Row.RowType as pager. If so, take the count of pages as below :
int count = e.Rows.cells[0].controls[0].controls[0].count;
int count = e.Rows.cells[0].controls[0].controls[0].count;
for(int index=0; index<=count-1;index++)
{ System.Web.UI.WebControls.TableCell cell = (System.Web.UI.WebControls.TableCell)e.Rows.cells[0].controls[0].controls[0]; cell.Attributes.Add("onclick","alert('If you choose next page to navigate, the selected items will lost.')"; }
Pager row will be rendered as,
"
"
.To access this, we have to use controls[0].
| 1 | 2 | 3 |
.To access this, we have to use controls[0].
.jpg)
No comments:
Post a Comment