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

Set default PageIndex from markup

4 Answers 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Abhijit Shetty
Top achievements
Rank 2
Abhijit Shetty asked on 10 Oct 2012, 03:42 AM
Hi,
How to set default PageIndex of RadGrid from markup and not in code-behind.

Thanks in advance...

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Oct 2012, 04:06 AM
Hi,

One suggestion is that you can set the page index using the following javascript.
JS:
function pageLoad()
{
   var masterTable = $find("<%= RadGrid2.ClientID %>").get_masterTableView();
   masterTable.set_currentPageIndex(2);
}

Thanks,
Shinu.
0
Abhijit Shetty
Top achievements
Rank 2
answered on 10 Oct 2012, 04:13 AM
Thanks Shinu.
Actually i need to set it on markup so that i can fetch its values on Page_Load and bind data on RadGrid.
I found how to set default sortExpression and filterExpression but no luck with setting PageIndex.
Do radgrid have such option?
0
Accepted
Shinu
Top achievements
Rank 2
answered on 11 Oct 2012, 04:14 AM
Hi,

As far as I know, we cannot set the page index from mark up. Either you can use the client side approach given above or in code behind as  RadGrid1.CurrentPageIndex = 2. Hope this helps.

Thanks,
Shinu.
0
Abhijit Shetty
Top achievements
Rank 2
answered on 11 Oct 2012, 04:17 AM
Thanks.
That is what i wanted to know...
Tags
Grid
Asked by
Abhijit Shetty
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Abhijit Shetty
Top achievements
Rank 2
Share this question
or