RadDataPager findcontrol returns null in some situation

hi my dear friends : i have a radcombobox that is in relationship with RadListViw (with RadDataPager Inside)... when i change the item of rad combobox , so RadListView is Updated... selectedIndexxhanged() server-side event... my selectedIndexChanged() is like this :

protected void RadcbImagesGroup_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
{
    rlvImages.DataBind();
    var raddatapager = (rlvImages).FindControl("RadDataPager1") as RadDataPager;
    if (raddatapager != null)
    {
        raddatapager.FireCommand("Page","First");
    }

}

my radComboBox Item values is like : 1,2,3...

in mode 1 we have 25 pages... in mode 2 we have 5 pages... in mode 3 we have 5 pages...

my problem is when we are in mode 1 and put the pageNumber to more than 5 and when i change the combobox Item to mode 2 so var raddatapager = (rlvImages).FindControl("RadDataPager1") as RadDataPager; is null...

but if we put the page# (we are in mode 1) to lower than 5 or equal 5 , and change the radcb item to another everything works fine...

where is the null problem?

thanks in advance

Answers


i could n't figure out what was the null problem ... but the below code solved my issue by the other way :

 rlvImages.CurrentPageIndex = 0;

instead of :

var raddatapager = (rlvImages).FindControl("RadDataPager1") as RadDataPager;
if (raddatapager != null)
{
    raddatapager.FireCommand("Page","First");
}

Need Your Help

Using Google Breakpad HTTPUpload functionality on Linux

linux upload breakpad google-breakpad

I am currently using Google Breakpad in my Linux app. I built breakpad by configure&make, I am linking /src/client/linux/libbreakpad_client.a and it works fine, dump is created in case of crash...

Delphi - TDataSet determine if it was modified when is in insert/edit state

delphi dataset delphi-2006

how can I find out if an data-aware component field has been modified when the dataset is already in Insert state? I want to know if a field was 'really' modified. (I don't care if the user has input

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.