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

RadGrid show-off in paging

2 Answers 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brygom
Top achievements
Rank 1
Brygom asked on 21 May 2009, 08:04 PM

Hi! I have a problem with the RadGrid, I am show a lot data en grid using paging, but if I select another page the radgrid show-off

i hope your help.

This is my code:

 RadGrid1.DataSource = data.Query("NoTarjeta", selectsNoTarjeta, "NoTarjeta", toSearch, "%");
RadGrid1.DataBind();

The method Query is:

public DataSet Query(String type, String selects, String paramWhere, String compare, String comodin)
{
List<string> byTable = new List<string>();

  String Query = null;



byTable=searchTables(type);

foreach (string table in byTable) // Loop through List with foreach
{
Query = "SELECT " + selects + " FROM " + table + " WHERE " + paramWhere + " LIKE '" + compare + comodin + "' UNION ALL " + Query;
}
Query = Query.Substring(0, Query.Length - 10);

ConnectToDatabase("localhost", 3306, "data", "root", "xxx");
MySqlDataAdapter adapter = new MySqlDataAdapter(Query, Userconection);
adapter.Fill(Results);
Userconection.Close();

return Results;
}

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" height="200px" 
width="994px">
<asp:TextBox ID="txSearch" runat="server" Width="343px"></asp:TextBox>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
<br />
<telerik:RadGrid ID="rgResults" runat="server" AllowPaging="True" 
AllowSorting="True" Skin="Telerik">
</telerik:RadGrid>
</telerik:RadAjaxPanel>

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 22 May 2009, 04:09 AM
Hi Brygon,

You are using simple-Databinding the for the Grid. Try binding the Grid in the NeedDataSource event. Go through the following online demo for getting more details about AdvanceDataBinding techniques.
Advanced Data Binding

Thanks
Shinu
0
Brygom
Top achievements
Rank 1
answered on 23 May 2009, 06:06 PM
Thanks for you reply! 
Tags
Grid
Asked by
Brygom
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Brygom
Top achievements
Rank 1
Share this question
or