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

[Solved] Pagination

7 Answers 137 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sangeetha
Top achievements
Rank 1
Sangeetha asked on 29 May 2008, 06:42 AM

 In datagrid Itemtemplate column i have placed the textboxes(2 columns are textboxes and rest of the columns are label).Text 1 is amount text2 is percentage.
 Using JS calculated the percentage and amount in the onblur event.if user changes the data without saving the data then goes to page 2 then back to page 1 user lost the changes at that i want ask the user to save data then go to page 2.

 When the page index is changed, we lost the values of other pages.
When i change the page and then turn back, all the changes have been lost.

 while woking with DataGrids on the PageIndexChanged event i want to take a confirmation from the user to continue for the next page or not.
 
  How could i do this?

Regards
Sangeetha

7 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 29 May 2008, 06:53 AM
Hi Sangeetha,

You can use the approach from this example (handle window.onunload):
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Client/ClientDelete/DefaultCS.aspx


Regards,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Sangeetha
Top achievements
Rank 1
answered on 29 May 2008, 07:41 AM
Hi,
 
  Thanks for your repsonse.I saw this demolink that is useful for when user delete the item.but i need when user click on the paging if goes to page 2,3 like that.
    One more question can i manually set the page index to grid if i click on the page 2 then set the page 3.
   How could i do.its very urgent.Please help me.

Regards
Sangeetha
0
Shinu
Top achievements
Rank 2
answered on 29 May 2008, 10:45 AM
Hi,

You can manually set the PageIndex as shown below.

CS:
  RadGrid1.CurrentPageIndex = 2

Shinu
0
Sangeetha
Top achievements
Rank 1
answered on 29 May 2008, 12:12 PM
Hi ,

    Thanks then how could i call confirmation messagebox, when page index changed event.

Regards
Sangeetha
0
Shinu
Top achievements
Rank 2
answered on 30 May 2008, 03:39 AM
Hi,

Try the following code snippet.

CS:
 protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridPagerItem) 
        { 
            GridPagerItem pagitm = (GridPagerItem)e.Item; 
            pagitm.Attributes.Add("OnClick", "return Confirm();"); 
        } 
    } 


JS:
 <script type="text/javascript" language="javascript"
     
         function Confirm() 
         { 
         alert('Move to Next Page?'); 
         } 
      
     </script> 

Hope this helps ..
Shinu.
0
Sangeetha
Top achievements
Rank 1
answered on 30 May 2008, 10:00 AM
Hi Shinu,

       Its working fine.Thanks for your reponse. 

Regards
Sangeetha
0
Princy
Top achievements
Rank 2
answered on 30 May 2008, 11:15 AM
Hi Sangeetha,

You can also try it in the following way.

CS:
  protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        if (e.Item is GridPagerItem)  
        {   
         GridPagerItem pageritm=(GridPagerItem)e.Item;  
         pageritm.Attributes.Add("OnClick", "return  confirm('Move to Next Page ?')");  
 
        }  
    } 

Thanks
Princy.
Tags
Grid
Asked by
Sangeetha
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Sangeetha
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Princy
Top achievements
Rank 2
Share this question
or