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

[Solved] the focus is not set to the first page

4 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Susanna Wiedemann
Top achievements
Rank 2
Susanna Wiedemann asked on 19 Aug 2009, 12:00 PM
Dear all

I created a grid and added a separate search field outside this grid. The paging within the grid is activated. Everything is working fine, but I have a very strange problem.

When I do a search where more than one page is showed and moved to one of the next pages (e.g. page 5) and I run another search with more than 5 pages, the actual page won't change to the first one (still page 5 is activated).

I have this problem only with the selfmade search-field. And the search itself is working fine.

Has anybody an idea what to do?

Thanks a lot for your help

Marino

4 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 19 Aug 2009, 02:44 PM
Hi Marino,

You may need to reset the grid  page index - RadGrid1.CurrentPageIndex = 0.

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Susanna Wiedemann
Top achievements
Rank 2
answered on 19 Aug 2009, 03:00 PM
Hi Vlad

Thanks for the hint.... It's working half of the times now.

e.g.:

- i change to page 4
- i enter something in the search field ("18") and search (by pressing a search button) for it
--> it doesn't change to page 1
- i press the search button again, without changing anything
--> it jumps to the first page

code:
    Protected Sub btnSearch_Click(ByVal sender As ObjectByVal e As System.Web.UI.ImageClickEventArgs) Handles btnSearch.Click  
        RadGrid1.Rebind()  
        RadGrid1.CurrentPageIndex = 0  
    End Sub 
 
    Protected Sub RadGrid1_NeedDataSource(ByVal source As ObjectByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource  
        Dim myLMFList As List(Of v_LMF)  
 
        If txtSearch.Text = "" Then 
 
            myLMFList = Controller.LoadAll  
            RadGrid1.DataSource = myLMFList  
        Else 
            'search in all depots by textbox entry  
            myLMFList = Controller.FindAll(txtSearch.Text, drpSearch.Text)  
            RadGrid1.DataSource = myLMFList  
        End If 
 
    End Sub 
 

 

Is there something more I need to add?

Thanks a lot for your help

Marino

0
Accepted
Vlad
Telerik team
answered on 19 Aug 2009, 03:02 PM
Hello Marino,

Can you please try to set this before Rebind() call and let me know about the result?

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Susanna Wiedemann
Top achievements
Rank 2
answered on 19 Aug 2009, 03:06 PM
Hi Vlad

It is working, if I reset the page index before the rebind().

Thanks a lot for your help

Marino
Tags
Grid
Asked by
Susanna Wiedemann
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Susanna Wiedemann
Top achievements
Rank 2
Share this question
or