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

Pagination problem!

2 Answers 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brygom
Top achievements
Rank 1
Brygom asked on 25 May 2009, 05:17 PM

Hi, i use a radgrid, if i select other page don't show anhyting.

I using this:

<telerik:RadGrid ID="rgResults" runat="server" AllowPaging="True" 
AllowSorting="True" OnNeedDataSource="rgResults_NeedDataSource" 
GridLines="None" Skin="WebBlue" 
onitemcommand="rgResults_ItemCommand" >
<FilterMenu EnableTheming="True">  
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
<PagerStyle FirstPageToolTip="Primera Página" LastPageToolTip="Última Página" 
NextPagesToolTip="Siguiente Página" NextPageToolTip="Siguiente Página" 
PagerTextFormat="Cambiar Página: {4} &amp;nbsp;Página &lt;strong&gt;{0}&lt;/strong&gt; de &lt;strong&gt;{1}&lt;/strong&gt;, Registros &lt;strong&gt;{2}&lt;/strong&gt; a &lt;strong&gt;{3}&lt;/strong&gt; de &lt;strong&gt;{5}&lt;/strong&gt; Encontrados." 
PrevPagesToolTip="Página Anterior" PrevPageToolTip="Página Anterior" />
<MasterTableView NoMasterRecordsText="No se encontraron registros." >  
<Columns>
<telerik:GridButtonColumn CommandName="Select" Text="Ver" 
UniqueName="column">
</telerik:GridButtonColumn>
</Columns>
<PagerStyle FirstPageToolTip="Primera Página" LastPageToolTip="Última Página" 
NextPagesToolTip="Siguiente Página" NextPageToolTip="Siguiente Página" 
PagerTextFormat="Cambiar Página: {4} &amp;nbsp;Página &lt;strong&gt;{0}&lt;/strong&gt; de &lt;strong&gt;{1}&lt;/strong&gt;, Registros &lt;strong&gt;{2}&lt;/strong&gt; a &lt;strong&gt;{3}&lt;/strong&gt; de &lt;strong&gt;{5}&lt;/strong&gt; encontrados." 
PrevPagesToolTip="Página Anterior" PrevPageToolTip="Página Anterior" />
</MasterTableView>
<GroupingSettings GroupSplitDisplayFormat="Mostrando {0} de {1} registros." />
<ClientSettings AllowExpandCollapse="False" AllowGroupExpandCollapse="False" 
AllowKeyboardNavigation="True">
<DataBinding EnableCaching="True">
</DataBinding>
<Selecting AllowRowSelect="True" />
<ClientMessages PagerTooltipFormatString="Página &lt;strong&gt;{0}&lt;/strong&gt; de &lt;strong&gt;{1}&lt;/strong&gt;" />
</ClientSettings>
<SortingSettings SortedAscToolTip="Ordenar Ascendente" 
SortedDescToolTip="Ordenar Descendente" SortToolTip="Haga clic para ordenar" />
</telerik:RadGrid>

And codebehind:

  protected void rgResults_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{

DataSet Results = new DataSet();          Userconection.ConnectionString = "Server=" + server + ";Port=" + port + ";Database=" + database + ";Uid=" + user + ";Pwd=" + paswd + ";";

Userconection.Open();

MySqlDataAdapter adapter = new MySqlDataAdapter("Select ID from table1", Userconection);
adapter.Fill(Results);

             rgResults.DataSource =Results;

}

Thanks for you help!

Briayan

2 Answers, 1 is accepted

Sort by
0
Accepted
Sebastian
Telerik team
answered on 28 May 2009, 01:46 PM

Hello Brygom,

Can you please verify that you configured the grid using advanced binding with NeedDataSource handling as shown here and that you do not have any DataBind() or Rebind() calls executed each time inside the PageLoad or PreRender handlers of the page? This should ensure that the paging feature of the control will work as expected.
 
Best regards,

Sebastian
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
Brygom
Top achievements
Rank 1
answered on 28 May 2009, 10:07 PM
Thanks for you help!
Tags
Grid
Asked by
Brygom
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Brygom
Top achievements
Rank 1
Share this question
or