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

RadDataPager Recognizing returns null in some conditions

2 Answers 54 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Majid Darab
Top achievements
Rank 1
Majid Darab asked on 19 May 2011, 11:07 AM
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 for advance

2 Answers, 1 is accepted

Sort by
0
Majid Darab
Top achievements
Rank 1
answered on 19 May 2011, 06:49 PM
hi dear telerik team !
it seems other people have this null problem too!

would you plz let us to know what is the problem!
0
Veli
Telerik team
answered on 20 May 2011, 02:21 PM
Hi Majid,

The code you provided does not give us any clues as to what might be causing this issue. The only thing we notices is that you are manually databinding RadListView by calling DataBind(). With paging enabled, we recommend using Advanced RadListView DataBinding using the NeedDataSource event. If this issue persists, consider sending us some sample code related to RadListView's and RadComboBox's definition, so that we can have a better idea of your exact scenario.

Greetings,
Veli
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
ListView
Asked by
Majid Darab
Top achievements
Rank 1
Answers by
Majid Darab
Top achievements
Rank 1
Veli
Telerik team
Share this question
or